0
0
Supabasecloud~5 mins

Running migrations locally and remotely in Supabase - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a database migration?
A database migration is a way to change the database structure, like adding or changing tables, so the app can work with new features or fixes.
Click to reveal answer
beginner
Why run migrations locally before remotely?
Running migrations locally helps catch errors early and ensures changes work before updating the live database, avoiding downtime or data loss.
Click to reveal answer
beginner
How do you run a migration locally with Supabase CLI?
Use the command supabase db migrate up to apply migrations to your local development database.
Click to reveal answer
intermediate
How do you apply migrations to a remote Supabase database?
Use supabase db migrate up or connect your CI/CD pipeline to run migrations on the remote database safely.
Click to reveal answer
intermediate
What should you do if a migration fails on the remote database?
Check error messages, fix the migration script locally, test again, then reapply. Always back up data before running migrations remotely.
Click to reveal answer
Which command applies migrations to your local Supabase database?
Asupabase db migrate up
Bsupabase db remote commit
Csupabase start
Dsupabase migrate run
Why is it important to run migrations locally first?
ATo speed up the internet
BTo avoid errors on the live database
CTo delete old data
DTo backup the remote database
What is a safe practice before running migrations remotely?
AIgnoring errors
BDeleting all tables
CBacking up the database
DRunning migrations twice
Which tool helps automate running migrations on remote Supabase databases?
ABrowser
BText editor
CEmail client
DCI/CD pipeline
If a migration fails remotely, what is the first step?
ACheck error messages
BDelete the database
CIgnore the failure
DRun migrations locally again
Explain the steps to run database migrations locally and then remotely using Supabase.
Think about testing first, then safely updating the live database.
You got /4 concepts.
    Describe best practices to follow when running migrations on a remote database.
    Focus on safety and reliability.
    You got /4 concepts.