fix(server): restore drizzle meta snapshots + drop dead annotations table #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/drizzle-meta-snapshots"
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?
Repairs the broken migration tooling found during the review:
_journal.jsonlists migrations 0000–0007 butmeta/only had snapshots 0000–0002, sodrizzle-kit generatediffed against the stale 0002 snapshot and proposed spurious changes — no new migration could be generated.Repair (commit 1, purely additive): snapshots 0003–0007 were reconstructed by replaying history — for each migration, schema.ts was restored from the commit that added the SQL file, the journal truncated to the preceding entries, and
drizzle-kit generate --name <original tag>run; only the snapshot JSON was kept. The committed SQL files and journal are byte-identical to main (verified — deployed DBs track migrations by content, so they must not change). The snapshot id/prevId chain is intact 0002→…→0007.Notes from the replay: 0003's generated SQL differs in form from the committed hand-written DROP+CREATE but produces the same table shape (verified column-by-column); 0004's committed file prepends a hand-written DELETE dedupe; 0005/0006 were added in one commit so an intermediate schema was built for 0005; 0005–0007 generated byte-identical SQL.
Acceptance:
db:generatenow reports "No schema changes" (clean no-op); fresh-DB migrate applies all migrations.Commit 2: with generate working again, the dead
annotationstable (no repository method, route, or test — re-verified) is dropped via a proper generated0008_drop_annotationsmigration.Tests: 56 files / 311 passing, typecheck clean, fresh-DB migrate verified before and after the drop.
7ef3dfc16bto6dc344a152