Bird
0
0

What will happen if you run alembic downgrade -1 after applying several migrations?

medium📝 Predict Output Q5 of 15
FastAPI - Database Integration
What will happen if you run alembic downgrade -1 after applying several migrations?
AA new migration file will be created
BAll migrations will be undone and database reset
CAn error occurs because -1 is invalid
DThe database schema will revert by one migration step
Step-by-Step Solution
Solution:
  1. Step 1: Understand downgrade command with relative revision

    Using -1 tells Alembic to revert the last applied migration.
  2. Step 2: Effect on database schema

    The schema will rollback one step, undoing the last migration changes.
  3. Final Answer:

    The database schema will revert by one migration step -> Option D
  4. Quick Check:

    Downgrade -1 = rollback one migration [OK]
Quick Trick: Use downgrade -1 to undo last migration step [OK]
Common Mistakes:
MISTAKES
  • Thinking downgrade -1 resets all migrations
  • Assuming it creates a migration file
  • Believing -1 is an invalid argument

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FastAPI Quizzes