Branching Issues

How do I ensure creating a new branch copies my DB set up from main. I’m using the +Creat Branch button, but every time it’s a completely blank slate. I've been building my app for a while direct in prod, but as it's grown and gotten more complex, I'm wanting to add a dev db. I watched a SB video where the crest button just auto copied from main, but that's not my experience. Any help would be awesome. Thanks!
29 Replies
silentworks
silentworks3w ago
What video did you watch? and I'd hope it not copy from main as yours does right now because that behaviour would be flawed as production data should never be shared downstream. Proper order of development that has been in practice for decades is that you go from dev -> staging -> production, not production -> staging -> dev.
adllcz
adllcz3w ago
This is exactly what I wanted to ask here - I have the same problem Here is the video @mmckillen referred to (I hope so): https://youtu.be/AMQqhHxz5UI?si=GEFs3-OEuaFKq_AL&t=83 Right now I have main, I create branch develop where I want to have tables, RLS, schemas, etc, but I'm getting just blank project with nothing in it. Any idea?
Supabase
YouTube
We made Branching a whole lot easier!
Supabase Branching allows you to spin up clones of your Database and Edge Functions to use during feature development. In this video, Jon Meyers demonstrates how to manage branches directly in the Supabase Dashboard - great for quickly prototyping ideas! 🚀 https://supabase.com/blog/branching-2-0 00:00 Supabase Branching 00:12 Cloning your D...
mmckillen
mmckillenOP3w ago
Yup. That's the one. @silentworks - any ideas here?? @adllcz - I posted in the community form and submitted a support ticket. I spent hours in vO and Vercel trying to recreate the environment and just couldn't get it done with confidence. I'll keep you posted if I get an answer there first.
silentworks
silentworks2w ago
So are you saying the tables did not get created on the new branch?
K D
K D2w ago
I'm having the same issue. When I create new branch, my tables, functions etc, is not copied to new branch. I understand the data should not be copied but I believe Tables, Functions and all other things should be. Maybe I'm wrong 🤷‍♂️
silentworks
silentworks2w ago
Yeah those should be copied, is it possible for you to do a screen recording of this not working so I can share with the Supabase team. I don't have branching in any of my projects so I'm unable to test this.
mmckillen
mmckillenOP2w ago
Loom
Creating a New Branch in GitHub for Testing 🚀
In this video, I walk you through the process of creating a new branch in GitHub, specifically naming it
mmckillen
mmckillenOP2w ago
(Forgive Loom auto name for this... Clearly in SB)
silentworks
silentworks2w ago
I noticed the status was still blinking when you switched to the tables, did you take a look to see if any of the services were not available or if the tables appeared later on?
mmckillen
mmckillenOP2w ago
Yes can confirm still totally empty...
No description
No description
silentworks
silentworks2w ago
Thanks for the follow up, I've sent over a message to the Supabase team and I'm waiting to hear back from them.
mmckillen
mmckillenOP2w ago
Amazing. Thanks for the assist!
K D
K D2w ago
Question? Where I can seek help for creating a branch. I tried a few times but each time when I create a branch it will generate an empty project(branch). So no functions, table, anything.
No description
silentworks
silentworks2w ago
We are waiting to hear from the Supabase team about his as many have experienced this issue.
K D
K D2w ago
Ok, thank you for the update. I really appreciate that.
mmckillen
mmckillenOP2w ago
For what it's worth. I got this back from a support ticket. Haven't don't much with this yet... planning on digging in this weekend.
No description
silentworks
silentworks2w ago
For everyone having this issue I was told that it can be fixed by truncating your migrations table on your main branch.
truncate supabase_migrations.schema_migrations
truncate supabase_migrations.schema_migrations
And if you are using the CLI with datbase migrations, you have to delete supabase/migrations locally, and then run supabase migration fetch to sync up with remote.
seno
seno2w ago
@silentworks I ran that in the "sql editor" in main. it was successful. I then created a new branch. still tables not being created
silentworks
silentworks2w ago
Ok I will pass this feedback along. At the same time can everyone in this post create a support ticket please.
seno
seno6d ago
@silentworks I created a support ticket yesterday. this is so annyoing, such an important feature not working... anyone has any update on this? @silentworks any update on this? we basically cannot create branches, I think this is a relatively very important issue. thanks
silentworks
silentworks6d ago
I don't have any updates.
TOM
TOM6d ago
I'm also having this issue @seno, I put in a support ticket 4 days ago
silentworks
silentworks6d ago
Things move a bit slower on the weekend.
malmazrou1993
malmazrou19936d ago
I am having the same issue after 3 weeks of 6 to 12 hours of daily debugging I found the culprit in my case, I had views that were using the WHERE clause like the following example:
where
u.user_id = auth.uid ();
where
u.user_id = auth.uid ();
After removing the the code above from all the views the branching and merging is working normally as expected if someone can also confirm this issue it will be great just note that WHERE clauses like the below example didn't cause any issues in my project:
where
b.active = true;
where
b.active = true;
seno
seno6d ago
@malmazrou1993 I dont have any views in my project and this still happens
malmazrou1993
malmazrou19936d ago
did you try truncating the supabase_migrations.schema_migrations table? can you share the logs of the created branch?
seno
seno4d ago
@malmazrou1993 supabase came back with a reply and they could reproduce the issue. let's see what happens any update on this? guess it's not a weekend anymore..
silentworks
silentworks4d ago
If you have a support ticket open, that's where you will get an update from Supabase. If I get an update I will post it here, but so far I haven't gotten any.
TOM
TOM4d ago
@silentworks I ended up being able to get this working by unlinking and re-linking my Github. It created a branch, it didn't have anything replicated over from my instance but I managed to get everything moved over.

Did you find this page helpful?