How to Run Migrations After Seeding with supabase db reset
Why Supabase db reset can fail after a schema change, and how Supabee keeps local resets aligned with production.
Say you are working on an order inventory system with a table like this:
public.orders
| id | customer_id | total | status |
|---|---|---|---|
| a12f… | c38e… | 48.50 | pending |
| b74d… | c38e… | 126.00 | paid |
| d09a… | e51b… | 19.99 | cancelled |
A new requirement replaces the status column, so you write a migration:
alter table public.orders drop column status;
alter table public.orders add column status_id bigint not null default 1;Testing locally with supabase migration up succeeds. supabase db push would work against the existing database too:
public.orders
| id | customer_id | total | status | status_id |
|---|---|---|---|---|
| a12f… | c38e… | 48.50 | pending | 1 |
| b74d… | c38e… | 126.00 | paid | 1 |
| d09a… | e51b… | 19.99 | cancelled | 1 |
After you push the migration, CI may run supabase db reset, or a teammate may run it locally. Reset reloads the seed, exposing a problem the earlier migration checks did not catch.
The status column no longer exists because the migration replaced it with status_id before seeding. You may get an error like this:
Applying migration 20260310090000_replace_order_status.sql...
Seeding data from supabase/seed.sql...
ERROR: column "status" of relation "orders" does not exist (SQLSTATE 42703)public.orders
| id | customer_id | total | status_id |
|---|---|---|---|
| a12f… | c38e… | 48.50 | pending |
| b74d… | c38e… | 126.00 | paid |
| d09a… | e51b… | 19.99 | cancelled |
The difference is the sequence: supabase db reset applies every migration first, then loads the seed. supabase db push and supabase migration up apply migrations to the existing database without reloading the seed.
The solution
The simplest workaround is to change the seed script so it no longer inserts the removed status column. But with a large database, keeping seed data compatible with every schema change quickly becomes impractical.
Use supabee db reset
Supabee finds the migration cutoff represented by your seed data and temporarily sets newer migrations aside. It runs supabase db reset to load the seed against the matching schema, then restores and applies those newer migrations with supabase migration up.