Path A baseline reconciliation. drizzle-kit pull against tia_prod showed
prod had drifted well past schema.ts because legacy hand-rolled migrations
0003-0015 wrote to the DB but were never reflected back into TypeScript.
Shared-table drift fixed:
- users: + password_hash, + password_updated_at
- families: + tier, + max_children, + max_members
- children: col is 'stage' (kept JS key currentStage -> stage);
'image_url' not 'profile_photo_url'; birth_date is DATE;
sex nullable; dropped phantom stage_overrides
- family_members: dropped phantom display_name
- family_invites: dropped phantom display_name, accepted_at
- audit_log: + resource_id, + resource_type; metadata -> jsonb; +5 indexes
- memories: + vision_tags (text[]), + vision_embedding (vector 1536)
- logs.ts: 'diapers' phantom table renamed to diapersLogs ('diapers_logs')
19 missing tables added across new files:
- admin.ts: admins, admin_sessions, password_resets
- support.ts: support_tickets, support_responses
- ai.ts: chat_sessions, chat_messages, ai_usage
- medical.ts: medicines, medication_doses, allergies, illness_logs, doctor_visits
- affiliate.ts: member_profiles, recommended_products, product_clicks
- logs.ts: + milestone_achievements
- audit.ts: + log_corrections
BUG FIX: schema/index.ts never re-exported ./logs — Drizzle was blind to
feeds/sleeps/vaccinations/growth/medications. Now exported.
Verified: tsc --noEmit has zero non-test errors. Dropped phantom columns
confirmed to have zero references in src/.
17 lines
633 B
TypeScript
17 lines
633 B
TypeScript
// Barrel export for the full Drizzle schema.
|
|
// Every schema file MUST be re-exported here so `import * as schema`
|
|
// in src/db/index.ts sees the complete table set.
|
|
//
|
|
// BUG FIXED AT BASELINE: ./logs was previously NOT exported here, so
|
|
// Drizzle never knew about feeds / sleeps / vaccinations / growth /
|
|
// medications / diapers. That is why those tables drifted unnoticed.
|
|
export * from "./auth";
|
|
export * from "./family";
|
|
export * from "./audit";
|
|
export * from "./media";
|
|
export * from "./logs";
|
|
export * from "./medical";
|
|
export * from "./admin";
|
|
export * from "./support";
|
|
export * from "./ai";
|
|
export * from "./affiliate";
|