Bird
0
0

What is the correct Laravel Artisan command to undo the most recent migration batch?

easy📝 Syntax Q3 of 15
Laravel - Database Basics and Migrations
What is the correct Laravel Artisan command to undo the most recent migration batch?
Aphp artisan migrate:reset
Bphp artisan migrate:rollback
Cphp artisan migrate:fresh
Dphp artisan migrate:refresh
Step-by-Step Solution
Solution:
  1. Step 1: Identify rollback command

    migrate:rollback undoes the last batch of migrations.
  2. Step 2: Differentiate from other commands

    migrate:reset rolls back all migrations, migrate:fresh drops all tables and migrates fresh, migrate:refresh rolls back all and migrates again.
  3. Final Answer:

    php artisan migrate:rollback -> Option B
  4. Quick Check:

    Rollback last batch only [OK]
Quick Trick: Rollback last batch with migrate:rollback [OK]
Common Mistakes:
  • Using migrate:reset instead of rollback
  • Confusing migrate:fresh with rollback
  • Using migrate:refresh to undo last batch

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes