0
0
Laravelframework~10 mins

Running and rolling back migrations in Laravel - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run all pending migrations in Laravel.

Laravel
php artisan [1]
Drag options to blanks, or click blank then click option'
Amigrate:refresh
Brollback
Cmigrate
Dmigrate:reset
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'rollback' instead of 'migrate' to run migrations.
Confusing 'migrate:reset' with running migrations.
2fill in blank
medium

Complete the code to rollback the last batch of migrations.

Laravel
php artisan [1]
Drag options to blanks, or click blank then click option'
Amigrate:rollback
Bmigrate
Cmigrate:reset
Dmigrate:refresh
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'migrate' instead of 'migrate:rollback' to undo migrations.
Confusing 'migrate:reset' with rollback.
3fill in blank
hard

Fix the error in the command to rollback all migrations.

Laravel
php artisan [1]
Drag options to blanks, or click blank then click option'
Amigrate:rollback --all
Bmigrate:refresh --step=all
Cmigrate:rollback --step=all
Dmigrate:reset
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to use '--all' option with rollback command.
Using 'migrate:refresh' instead of 'migrate:reset' to rollback all.
4fill in blank
hard

Fill both blanks to refresh the database by rolling back and re-running all migrations.

Laravel
php artisan [1] [2]
Drag options to blanks, or click blank then click option'
Amigrate:refresh
B--seed
C--force
Dmigrate:reset
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'migrate:reset' with '--seed' which is invalid.
Confusing '--force' with '--seed'.
5fill in blank
hard

Fill all three blanks to rollback the last two batches of migrations with force.

Laravel
php artisan [1] [2] [3]
Drag options to blanks, or click blank then click option'
Amigrate:rollback
B--step=2
C--force
Dmigrate:reset
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'migrate:reset' instead of rollback for partial rollback.
Omitting '--force' when running in production.