Watch: Track my database changes with migrations | Vovy
Watch Vovy do it on a Mac: "Set up Supabase migrations so my database changes are saved in git". Install the Supabase CLI, link your project, pull your current schema into a migration file and push future changes safely.
"Set up Supabase migrations so my database changes are saved in git"
Install the Supabase CLI, link your project, pull your current schema into a migration file and push future changes safely.
What happens in the video
- Install the Supabase CLI: The CLI is a Terminal tool for managing your project from code. Vovy installs it with Homebrew and runs supabase login, which opens your browser.
- Link your project: Vovy runs supabase init and supabase link with your project ref, then asks for your database password, which you paste yourself.
- Pull your current schema: Vovy runs supabase db pull, which saves every table and policy you made in the dashboard as a migration file.
- Make the next change as a migration: Vovy runs supabase migration new, writes your change as SQL, and shows the file so you see exactly what will happen.
- Push to your live database: Vovy asks, then runs supabase db push, which applies only migrations that haven't run yet. It commits the files to GitHub after.
Read the step-by-step guideLoading...