Switching Between two different local Supabase Projects issue
When switching between two Supabase projects using supabase link and supabase unlink, running supabase start for the previously linked project results in an error. It appears the local Supabase environment remains configured for the new project, causing conflicts.
To Reproduce
Steps to reproduce the behavior:
Create two Supabase projects: Set up two separate Supabase projects (e.g., Project A and Project B).
Link to Project A: In your terminal, navigate to your Project A directory and run supabase link --project-ref <Project A ref>.
Start Project A: Run supabase start. This should work correctly.
Link to Project B: Navigate to your Project B directory and run supabase link --project-ref <Project B ref>.
Start Project B: Run supabase start. This should also work correctly.
Unlink Project B: Run supabase unlink.
Attempt to start Project A: Navigate back to your Project A directory and run supabase start. This will likely result in an error.
Expected behavior:
supabase start should successfully start the local Supabase environment for Project A, regardless of previous linking to Project B.
10 Replies
I'm going to test this out
Do both your projects have the same
project_id
in the supabase/config.toml
file? That would case overlapping with the docker containers.I'm assuming from the instructions above that they aren't. But lets wait and see what the user answers.
Hi!
Thank you for your response
No they have different projectIds
The issue is coming in when I run supabase start
My health checks is unhealthy
I can share the error message
ERROR: type "one_time_token_type" already exists (SQLSTATE 42710)
At statement 0: create type "auth"."one_time_token_type" as enum ('confirmation_token', 'reauthentication_token', 'recovery_token', 'email_change_token_new', 'email_change_token_current', 'phone_change_token') This is the error I am getting
At statement 0: create type "auth"."one_time_token_type" as enum ('confirmation_token', 'reauthentication_token', 'recovery_token', 'email_change_token_new', 'email_change_token_current', 'phone_change_token') This is the error I am getting
That's from running
supabase start
? It really sounds like you're sharing the same project id.Wait but from your steps you are running both
supabase start
at the same time which isn't possible unless you change the ports.
Please provide correct steps as the steps you've outlined doesn't actually work.project_id = "EZXS"
project_id = "Code"
These are the two project ID's
I am actually stopping one project and running another one
But looks like there is an issue with Auth
Can't reproduce this issue after following your steps. I've done a screen recording of me following the steps without any issues.
Wild-assed guessing here: are you using an old version of the supabase CLI that wants to run an old version of the supabase docker image by default? I'm guessing when you do an unlink it removes the versions locked in by the
.temp
files and it has a clash in the DB versions.I fixed it, had to clean my Docker and unlink the project