Skip to main content

Source of truth

supabase/schemas/** is the canonical declarative desired-state for DDL. supabase/migrations/** — the 2026-05-28 baseline (00000000000000_baseline_2026_05_28_ddl.sql + …_data.sql) plus db diff-generated forward files — is what actually gets applied. (Backfill note: the existing schema is not yet bulk-exported into supabase/schemas/**; until that lands, the baseline + forward migrations are the operative SoT and schemas/** fills in as new DDL is authored declaratively.) Live projects: dev2 (anuwknikgsijbameytzr) / prod2 (aximlomrwfuhctxjhrsf).

Author DDL

  1. Edit supabase/schemas/**.
  2. npm run db:schemas:diff -- -f <name> to generate a migration.
  3. supabase db reset to apply locally; supabase db push to promote.
See the CLI workflow, migration lanes, and the declarative guide.

Regenerate types

npm run db:types (local) or npm run db:types:dev2 (from dev2). CI runs npm run db:types:check to catch DB↔types drift.

Never

Do not create or apply migrations via Supabase MCP (apply_migration) or the Dashboard — schema changes are CLI-only.