Bird
0
0

You want to undo all migrations and then re-run them fresh. Which command should you use?

hard📝 Application Q15 of 15
Laravel - Database Basics and Migrations
You want to undo all migrations and then re-run them fresh. Which command should you use?
Aphp artisan migrate:rollback
Bphp artisan migrate:refresh
Cphp artisan migrate:reset
Dphp artisan migrate:fresh
Step-by-Step Solution
Solution:
  1. Step 1: Understand the commands

    migrate:rollback undoes last batch, migrate:reset undoes all, migrate:refresh undoes all then re-runs, migrate:fresh drops all tables and migrates.
  2. Step 2: Choose command for undo and re-run

    migrate:refresh is the command that rolls back all migrations and then runs them again fresh.
  3. Final Answer:

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

    Refresh = rollback all + migrate again [OK]
Quick Trick: Refresh rolls back all then migrates again [OK]
Common Mistakes:
  • Using rollback to undo all migrations
  • Confusing reset with refresh
  • Using fresh which drops tables instead of rollback

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes