Bird
0
0

You run php artisan migrate:rollback --step=2 but get an error. What is a likely cause?

medium📝 Debug Q6 of 15
Laravel - Database Basics and Migrations
You run php artisan migrate:rollback --step=2 but get an error. What is a likely cause?
ARollback command requires --force flag
BThe --step option is not supported
CYou must run migrate:reset before rollback
DThere are fewer than 2 batches to roll back
Step-by-Step Solution
Solution:
  1. Step 1: Understand the --step option

    The --step option rolls back the specified number of batches if available.
  2. Step 2: Identify why error occurs

    If fewer than 2 batches exist, rollback cannot perform 2 steps and throws an error.
  3. Final Answer:

    There are fewer than 2 batches to roll back -> Option D
  4. Quick Check:

    Rollback step error = insufficient batches [OK]
Quick Trick: Check batch count before using rollback --step option [OK]
Common Mistakes:
  • Assuming --step is unsupported
  • Thinking migrate:reset is required before rollback
  • Believing rollback always needs --force

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes