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
what is dev here, another project?
@ihm40 A branch of my DB.

I executed the SQL here, but I can't find it in my migrations history. It's pretty annoying.

Because now obviously I want to apply those changes to prod.
go into manage branches, it should give you an option to merge dev into main

im not entirely familiar with this feature - can I pm? @ihm40
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
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.
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

Actually, I addressed that issue related to failing, so I'm not sure why it still presents itself.
thats for main i meant the dev branch
sorry

Not sure if reset branch means refresh or wipe it lol.
i wouldn't refresh, give me a sec. I'm going to create a branch
ok
are you using github for this or has this all been on ui?
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.
okay if you click create merge request where does it direct you, it should show you your changes
There's really nothing to compare.

Should I just do it from scratch? I probably would've been done already.
okay which branch are you currently on
main i assume?
yes
switch to dev and then press the same dropdown
you should hopefully see more options
oh no
i have been on dev sorry
I got this. Thank you
did you find it?
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...
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
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