0
0
Supabasecloud~5 mins

Creating migrations in Supabase - Quick Revision & Summary

Choose your learning style9 modes available
Recall & Review
beginner
What is a migration in the context of Supabase?
A migration is a file that records changes to the database schema, like creating or modifying tables, so you can apply these changes consistently across environments.
Click to reveal answer
beginner
How do you create a new migration using Supabase CLI?
You run the command supabase migration new <migration_name> to create a new migration file with the given name.
Click to reveal answer
intermediate
Why should migrations be version controlled?
Version control keeps track of all schema changes, helps teams collaborate, and allows you to roll back or replay changes safely.
Click to reveal answer
intermediate
What is the difference between 'up' and 'down' in a migration file?
'Up' defines the changes to apply (like creating tables), while 'down' defines how to undo those changes (like dropping tables).
Click to reveal answer
beginner
How do migrations help when working with multiple environments (development, staging, production)?
Migrations ensure that all environments have the same database structure by applying the same set of changes in order.
Click to reveal answer
Which command creates a new migration file in Supabase CLI?
Asupabase db create
Bsupabase migration new <migration_name>
Csupabase migration apply
Dsupabase start migration
What does the 'down' section in a migration file do?
ARuns tests on the migration
BApplies new changes to the database
CCreates a backup of the database
DRolls back or undoes changes
Why is it important to keep migrations in version control?
ATo track and manage schema changes safely
BTo speed up database queries
CTo share database passwords
DTo store user data
What is the main benefit of using migrations across multiple environments?
AAutomatically scales the database
BImproves network speed
CEnsures consistent database structure everywhere
DEncrypts data in transit
Which file type usually contains migration scripts in Supabase?
A.sql
B.html
C.json
D.js
Explain the purpose of migrations in Supabase and how they help manage database changes.
Think about how you keep track of changes to your database structure over time.
You got /4 concepts.
    Describe the steps to create and apply a migration using Supabase CLI.
    Consider the commands and actions needed from creating to applying a migration.
    You got /4 concepts.