Drizzle migration set is incomplete — 0000 does ALTER on tables that don't exist #85
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Where:
api/drizzle/0000_design_columns_and_indexes.sql,api/drizzle/meta/_journal.json,api/src/db/schema.ts.Bug:
api/drizzle/meta/_journal.jsonlists exactly one migration:0000_design_columns_and_indexes.ALTER TABLE "designs" ADD COLUMN "folder_id" uuid;(0000_design_columns_and_indexes.sql:1).designstable is never created.api/src/db/schema.ts:10-22declares it viapgTable('designs', {...})— drizzle-kit reads that file for the schema — but the migration0000_*.sqlcontains noCREATE TABLE.usersandexports(schema.ts:3-8, 24-32).npm run db:migrateagainst a fresh Postgres: fails withrelation "designs" does not exist.Fix consistent with existing patterns:
Regenerate the migration set so
0000contains the CREATE statements and subsequent ALTERs become their own numbered files.0000_design_columns_and_indexes.sqland its meta snapshot.ALTER TABLE designs ADD COLUMN...lines must persist (i.e. they were hand-edited to add columns not inschema.ts), port those intoschema.tsfirst so the regenerated0000includes them, then split any post-0000changes into0001_*.sqlfiles generated by drizzle-kit.npm run db:migratefrom clean — succeeds;psql -c '\d designs'shows the columns from both the schema and the original ALTER set.Acceptance: a fresh Postgres boots, migrations apply without error, and the
designstable contains every column the schema + the original ALTER set describe.api/Express stub — zero callers, 11 unused deps, dead vite proxy/api/v1 → :3001#113