What if one simple command could keep your local and cloud databases perfectly matched every time?
Why Running migrations locally and remotely in Supabase? - Purpose & Use Cases
Imagine you have a database for your app. You make changes to its structure by hand on your computer, then try to do the same on the cloud server. You have to remember every change and type it again carefully.
This manual way is slow and risky. You might forget a step or make a typo. Your app could break because the local and remote databases don't match. Fixing these mistakes takes a lot of time and stress.
Running migrations locally and remotely means writing your database changes once and applying them automatically everywhere. This keeps your databases in sync without errors or extra work.
ALTER TABLE users ADD COLUMN age INT; -- Then manually run the same on remote
supabase migration up -- Applies pending migrations remotely (local via supabase start)
You can update your database safely and quickly, whether on your computer or in the cloud, without worrying about mistakes.
A developer updates the user profile table to add a new field. They run the migration command once, and both their local setup and the live app's database update perfectly in sync.
Manual database updates are slow and error-prone.
Migrations automate and sync changes locally and remotely.
This saves time and prevents app-breaking mistakes.