Migration and startup invariants
View as MarkdownIdentity
Section titled “Identity”Drizzle migration artifacts, assertMigrationsReady, generated boot, and
container command.
Contract
Section titled “Contract”db:generatecreates migration SQL plus Drizzle journal/snapshot state, and those artifacts are reviewed before deployment.db:checkvalidates the Drizzle snapshot chain. It does not inspect the live database or prove that a migration was applied.- One deployment job applies pending migrations before new application replicas serve traffic.
- When registered tables exist, server startup refuses:
- a missing or unreadable migration directory;
- a migration file present on disk but absent from the applied ledger;
- an applied ledger entry whose migration is missing from disk; or
- an applied migration whose on-disk hash changed.
- Server startup validates this applied-ledger readiness and never applies migrations from boot or request handling.
- A failed migration or readiness mismatch is a startup/release failure.
- Database backup and application rollback do not automatically reverse destructive SQL.