Skip to content

fix(db): fail-closed drizzle journal gate before migrate - #736

Open
btipling wants to merge 1 commit into
mainfrom
fix/drizzle-journal-gate
Open

fix(db): fail-closed drizzle journal gate before migrate#736
btipling wants to merge 1 commit into
mainfrom
fix/drizzle-journal-gate

Conversation

@btipling

Copy link
Copy Markdown
Owner

Summary

`drizzle-kit migrate` only applies tags in `meta/_journal.json`. SQL on disk without a journal entry is a silent no-op — that is how Skills stayed unavailable after green db-migrate runs (#735).

This adds `scripts/drizzle-journal-gate.mjs`: every `db/migrations/*.sql` must have a matching journal tag (and vice versa; idx sequential; no dupes). Fail closed before mutate.

Hook When
GHA db-migrate After Node setup, before `drizzle-kit migrate`
GHA db-tenancy-backfill-deks When `run_migrate`
`npm test` Next to di-gate
`npm run db:migrate` Before the kit

Today the gate passes: 15 SQL files match the journal (0012–0014 landed in #735). A replay of the old journal (stop at 0011) would have failed the job instead of reporting success.

drizzle-kit migrate only applies tags in meta/_journal.json. SQL on disk
without a journal entry is a silent success (0012–0014 / #735). Gate
scripts/drizzle-journal-gate.mjs so GHA db-migrate, DEK-backfill migrate,
npm test, and npm run db:migrate die if SQL files and journal tags diverge.
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
invincible Ignored Ignored Aug 20, 2026 8:59am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant