-
Notifications
You must be signed in to change notification settings - Fork 298
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
After creating some data in my local supabase instance, and running supabase stop --backup
followed by supabase start
, I see an error saying that a migration has failed. Running supabase start
a second time goes through successfully but all the data from my DB has been lost.
To Reproduce
supabase start
- Generate a migration to create a new table
- Add some data, like a single user
supabase stop --backup
supabase start
- See the error as it tries to apply the migration even though the table already exists.
- If you run
supabase start
again, it will succeed but all the data that was supposed to be backed up will be gone.
Expected behavior
After running supabase stop --backup
, I should be able to restart the DB using supabase start
without any problems.
Screenshots
Error output after the first supabase start
command:
> SUPABASE_INTERNAL_IMAGE_REGISTRY=docker.io npx supabase start
Setting up Edge Functions runtime...
Applying migration 20230420113929_create_profiles_table.sql...
Error: ERROR: relation "profiles" already exists (SQLSTATE 42P07)
At statement 0: create table profiles (
id uuid references auth.users not null,
username text unique,
avatarUrl text,
website text,
bio text,
joinedAt timestamp with time zone default timezone('utc'::text, now()) not null,
primary key (id),
unique(username)
)
Try rerunning the command with --debug to troubleshoot the error.
System information
- OS: macOS
- Browser (if applies): NA
- Version of supabase-js: 1.53.0
- Version of Node.js: v16.15.1
Additional context
My guess would be that the migrations table is not being backed up correctly, resulting in supabase trying to reapply migrations that have already been applied before and resulting in errors.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working