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
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.
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...
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.
So are you saying the tables did not get created on the new branch?
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 🤷♂️
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.
Here you go - https://www.loom.com/share/f359a3a8a5bc450384a93f651d89dc7a?sid=62c05545-3947-4b25-9bea-547689f87300
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
(Forgive Loom auto name for this... Clearly in SB)
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?
Yes can confirm still totally empty...


Thanks for the follow up, I've sent over a message to the Supabase team and I'm waiting to hear back from them.
Amazing. Thanks for the assist!
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.

We are waiting to hear from the Supabase team about his as many have experienced this issue.
Ok, thank you for the update. I really appreciate that.
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.

For everyone having this issue I was told that it can be fixed by truncating your migrations table on your main branch.
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.@silentworks I ran that in the "sql editor" in main. it was successful.
I then created a new branch.
still tables not being created
Ok I will pass this feedback along. At the same time can everyone in this post create a support ticket please.
@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
I don't have any updates.
I'm also having this issue @seno, I put in a support ticket 4 days ago
Things move a bit slower on the weekend.
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:
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:
@malmazrou1993 I dont have any views in my project and this still happens
did you try truncating the supabase_migrations.schema_migrations table?
can you share the logs of the created branch?
@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..
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.
@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.