CampusSyncFEATUREDSchema changes ship as expand, deploy, contract, applied by a small gated runner instead of pasted by hand
ADOPTED
Schema changes ship as expand, deploy, contract, applied by a small gated runner instead of pasted by hand
Context
Decision
Alternatives considered
- One big-bang migration applied with the deploy. The old code still ran against the old shape for a while after the deploy began; the staged order avoids a window where either is wrong.
- Keep applying SQL by hand in the Supabase editor. No ledger, no order, no check that a file was run or what changed; this is what the cleanup replaced.
- The Supabase CLI's db push. The author's reasoning was file naming and the lack of a baseline schema in the repository. That was not tested against the CLI, so it is an unverified rejection.
What happened
Evidence
- pull requestPull request #32 ↗Automatic migrations: ordered, gated, validated in CI on a real Postgres
- commit1a569d6 ↗migrations: automatic, ordered, gated application with a zero-dependency runner, a GitHub workflow and a CI replay
- docdocs/MIGRATIONS.md ↗how it works: phases, directives, ledger, approval gate and the CI replay
- filesupabase/migrate/migrate.mjs ↗the runner
- pull requestPull request #26 ↗the staged cleanup migrations it applies
- benchmarkdocs/BENCHMARKS.md section 7 ↗the timings of the whole migration chain on a copy with about one million certificates
How this was checked: Read MIGRATIONS.md (phases, directives, ledger, CI job) and listed the runner and migration files. I did not run the runner or the migrations. The Supabase CLI rejection is the author's reasoning and was never tested.
Recorded at the time (a document or commit message states it) · reasons are stated in the repository · pull requests #26 (the staged migrations) and #32 (the runner), both merged 2026-10-15