Supabee.

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

idcustomer_idtotalstatus
a12f…c38e…48.50pending
b74d…c38e…126.00paid
d09a…e51b…19.99cancelled

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

idcustomer_idtotalstatusstatus_id
a12f…c38e…48.50pending1
b74d…c38e…126.00paid1
d09a…e51b…19.99cancelled1

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

idcustomer_idtotalstatus_id
a12f…c38e…48.50pending
b74d…c38e…126.00paid
d09a…e51b…19.99cancelled

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.

supabase db reset
supabase db resetThe schema dump restores Migrations 1 and 2, new Migrations 3 and 4 change it, and the older data dump then conflicts with that changed schema.Schema dumpData dumpMigration #1Migration #2New Migration #3New Migration #4Seeding!ConflictSuccess
supabase db push
supabase db pushMigrations 1 and 2 and the existing data form the live database before new Migrations 3 and 4 are applied successfully.Live databaseMigration #1Migration #2SeedingNew Migration #3New Migration #4!ConflictSuccess

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.

supabee db reset
supabee db resetSupabee restores Migrations 1 and 2 from the schema dump, loads the data dump, and only then applies new Migrations 3 and 4 successfully.Schema dumpData dumpMigration #1Migration #2SeedingNew Migration #3New Migration #4!ConflictSuccess
supabase db push
supabase db pushMigrations 1 and 2 and the existing data form the live database before new Migrations 3 and 4 are applied successfully.Live databaseMigration #1Migration #2SeedingNew Migration #3New Migration #4!ConflictSuccess