wipe the shadow
Optional. Skipped when the shadow is already empty (CI service container, in-memory).
migrate / verify · 01 — The shadow gate
verify applies your pending migrations against a separate Postgres database, introspects the result, and diffs it against your declared schema. Anything missing is drift. The shadow is throwaway by design — destructive gates are off, no advisory lock is taken, nothing about the run is persisted.
02 — The four stages
One function does four things and returns a report. It never throws — the caller decides how to react to drift.
wipe the shadow
Optional. Skipped when the shadow is already empty (CI service container, in-memory).
run every pending migration
The same runner production uses, with the safety gates intentionally off — the shadow is throwaway.
read the result back
Walks pg_catalog. Rebuilds the same kind of schema graph the engine compiles queries through.
compare to declared
Every operation needed to bring the shadow's schema into the declared shape becomes a drift line.
03 — Three shapes
The shadow doesn't need to be a separate cluster — it just needs a Postgres connection that can be reset.
Two Postgres containers on different ports. Reset between verifies. Cheapest local setup.
GitHub or GitLab spawns a fresh Postgres per job. No reset hook needed — the env starts clean.
Same database server, isolated by search_path. Cheaper than a second cluster, fast to wipe.
04 — Four outcomes
CI scripts can branch on the exit code. Logic failures (drift, apply-failed) and config failures (unreachable shadow) get different codes — different problems, different fixes.
The shadow's resulting schema is identical to your declared schema. Re-run apply with the verified flag.
The shadow ran fine, but missing operations leave it diverging from declared. Regenerate or add the ops by hand.
The migration itself errored. Up against prod would error the same way. Diagnose with the shadow inspector.
Connection or auth issue with the shadow adapter. Different exit code from a logic failure.
The main page — the system overview, the contrast table, the lifecycle in summary.
/migrateGenerate, plan, verify, apply, audit. Real terminal output for each stage.
/migrate/lifecycleSix levels, twenty reason codes, three CI gates. Every op kind classified.
/migrate/riskFive artifact kinds, the bookkeeping table, the seven-command CLI.
/migrate/recoverQuery the audit tables — replay flows, drift, post-mortem patterns.
/migrate/auditApply migrations from the UI. Same engine, same gates, same shadow.
/studio