0
Challenge · 44Schema as Code

Branching, environments & CI

Toolingused in ~70% of apps

You open a PR that adds a column to `likes`. A teammate reviewing it can read the diff, but not run it — the only Postgres anyone can test against is the shared dev database five other people are also using. Someone merges first, your migration collides with theirs, and now the whole team's local environment is broken until someone figures out whose change landed wrong. A branch per PR, built from nothing but your migrations, is how this stops happening.

Core idea. A Supabase preview branch is a full, disposable project — Postgres, Auth, Storage, all of it — built by replaying your repo's `supabase/migrations` and `seed.sql` from empty, never by copying production's rows. CI does the same replay against production on merge (`supabase db push`), and a second CI job protects the thing branches can't check for you: that the generated types file committed to the repo still matches the schema you just changed.
Playground, this isn't a screenshot
PR #482 — add likes.reaction_type
Data
empty (no prod data, ever)
Branch status
building…
1 / 7
Your PR branch's code is checked out — nothing database-related yet.

The runner clones the repo at your commit. This step only sees files: your app code, and the supabase/migrations directory sitting inside it.

Toggle "migration has a bug" and replay. Notice Migrate and Seed are the only steps that can differ per PR — Clone, Pull, Health check and Configure are the same every time, because they never touch YOUR schema.

↑ play a little first, then dig in