S
Supabase2mo ago
Mas0n

Viewing and quickly applying migrations from dev to prod.

I cloned my prod db into dev and ran some migrations against it. Now I want to apply those migrations to Prod in my actual application. What's the quickest and simplest way to do it? Preferably through the web app/web SQL editor.
30 Replies
ihm40
ihm402mo ago
what is dev here, another project?
Mas0n
Mas0nOP2mo ago
@ihm40 A branch of my DB.
No description
Mas0n
Mas0nOP2mo ago
I executed the SQL here, but I can't find it in my migrations history. It's pretty annoying.
No description
Mas0n
Mas0nOP2mo ago
Because now obviously I want to apply those changes to prod.
ihm40
ihm402mo ago
go into manage branches, it should give you an option to merge dev into main
Mas0n
Mas0nOP2mo ago
No description
Mas0n
Mas0nOP2mo ago
im not entirely familiar with this feature - can I pm? @ihm40
ihm40
ihm402mo ago
its getting late where i am so i might not be around much longer and keeping it in public channels lets other people help out if i'm sleeping or at work so it's better to keep it here
Mas0n
Mas0nOP2mo ago
No worries, I'm not sure why this is so confusing. I made some changes in the dev database, but I don't have anything I can PR it into. I just want to see those changes. I basically added some RLS policies and another column on a couple of tables.
ihm40
ihm402mo ago
what do you see if you click the 3 dots bottom right on the dev branch. don't click anything yet because your logs are failing so probably shouldn't merge just yet
Mas0n
Mas0nOP2mo ago
No description
Mas0n
Mas0nOP2mo ago
Actually, I addressed that issue related to failing, so I'm not sure why it still presents itself.
ihm40
ihm402mo ago
thats for main i meant the dev branch
Mas0n
Mas0nOP2mo ago
sorry
No description
Mas0n
Mas0nOP2mo ago
Not sure if reset branch means refresh or wipe it lol.
ihm40
ihm402mo ago
i wouldn't refresh, give me a sec. I'm going to create a branch
Mas0n
Mas0nOP2mo ago
ok
ihm40
ihm402mo ago
are you using github for this or has this all been on ui?
Mas0n
Mas0nOP2mo ago
It's all been on UI. Creating a pull request makes no sense. But what's frustrating is I can't see my SQL execution history, and there's no rows in the Supabase.migrations table.
ihm40
ihm402mo ago
okay if you click create merge request where does it direct you, it should show you your changes
Mas0n
Mas0nOP2mo ago
There's really nothing to compare.
No description
Mas0n
Mas0nOP2mo ago
Should I just do it from scratch? I probably would've been done already.
ihm40
ihm402mo ago
okay which branch are you currently on main i assume?
Mas0n
Mas0nOP2mo ago
yes
ihm40
ihm402mo ago
switch to dev and then press the same dropdown you should hopefully see more options
Mas0n
Mas0nOP2mo ago
oh no i have been on dev sorry I got this. Thank you
ihm40
ihm402mo ago
did you find it?
ihm40
ihm402mo ago
i was about to send this https://youtu.be/AMQqhHxz5UI?t=252
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...
Mas0n
Mas0nOP2mo ago
I'm not going to spend more time on this at the moment. I'll just apply the migrations directly instead of trying to diff it thank u very much though
ihm40
ihm402mo ago
hmm okay, watch the video if you get time though. It fairly short and the timestamp that i shared provides how to merge branches and view changes

Did you find this page helpful?