SupabaseS
Supabase2mo ago
Rtdt

trouble creating production branch

hi all, until now i was working direct in main (production) supabase branch. But actually that was just intended as my testing environment and is also on the url testing.mydomain.com. Now i want to launch the service and create a proper production environment. So we tried to set up proper branching but got nowhere.

Here’s the case:
We have Github CI job that does the following to sync testing Subapase database and production. Testing contains the structure, production is newly create branch (no data):
⁠supabase link --project-ref $SUPABASE_PRODUCTION_PROJECT
⁠supabase db push

the job fails the initial run of db push (against newly created Supabase branch) with error:
Remote migration versions not found in local migrations directory.
Make sure your local git repo is up-to-date. If the error persists, try repairing the migration history table:
supabase migration repair --status reverted 20250812023229 20250813052841 20250813052857 20250825084519 20250825090720 20250825110134 20250825111958

And update local migrations to match remote database:
supabase db pull
Running db pull before doesn’t help, produces another error:
The remote database's migration history does not match local files in supabase/migrations directory.

Make sure your local git repo is up-to-date. If the error persists, try repairing the migration history table:
supabase migration repair --status reverted 20250812023229
supabase migration repair --status reverted 20250813052841

Migration files are present in supabase/migrations.

continued in comment below due to max message size...
Was this page helpful?