0
0
Supabasecloud~20 mins

Rolling back migrations in Supabase - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Supabase Migration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What happens when you run a rollback migration in Supabase?

In Supabase, you apply migrations to update your database schema. What is the result of running a rollback migration?

AThe migration is applied again, adding new tables and columns.
BThe database schema deletes all tables and data permanently.
CThe database schema reverts to the previous state before the last migration was applied.
DThe database connection is reset but schema remains unchanged.
Attempts:
2 left
💡 Hint

Think about what rollback means in the context of database changes.

Configuration
intermediate
2:00remaining
Which command correctly rolls back the last migration in Supabase CLI?

You want to undo the last migration applied to your Supabase database using the CLI. Which command should you use?

Asupabase db revert
Bsupabase db rollback
Csupabase db migrate undo
Dsupabase migration down
Attempts:
2 left
💡 Hint

Check the official Supabase CLI commands for migration rollback.

Architecture
advanced
3:00remaining
What is the best practice to ensure safe rollback of migrations in a production Supabase database?

When managing migrations in production, what practice helps ensure that rolling back a migration does not cause data loss or downtime?

AAvoid using migrations and manually change the schema in production.
BDelete the production database and restore from backup after rollback.
CApply rollbacks directly in production without testing to save time.
DAlways write reversible migrations with explicit down scripts and test them in staging before production.
Attempts:
2 left
💡 Hint

Think about how to avoid surprises when undoing database changes.

security
advanced
3:00remaining
Which security risk is most relevant when rolling back migrations in Supabase?

Rolling back migrations can affect database security. What is a key security risk to consider?

ARollback might remove security policies or roles, exposing data unintentionally.
BRollback encrypts all data, making it inaccessible.
CRollback disables all user authentication temporarily.
DRollback automatically grants admin rights to all users.
Attempts:
2 left
💡 Hint

Consider what schema elements control access and how rollback affects them.

🧠 Conceptual
expert
3:00remaining
After rolling back a migration that dropped a column, what happens to the data in that column in Supabase?

You rolled back a migration that previously dropped a column from a table. What is the state of the data that was in that column?

AThe column is restored but all previous data in it is lost permanently.
BThe column and all its data are fully restored as before the drop.
CThe column remains dropped and data is unrecoverable.
DThe column is restored with data encrypted and inaccessible.
Attempts:
2 left
💡 Hint

Think about how databases handle dropped columns and data storage.