How to Rollback one specific migration in Laravel?
How to Rollback one specific migration in Laravel?
To rollback one specific migration in Laravel, you can use the --path
option with the php artisan migrate:rollback
command. This allows you to specify the path to the particular migration file you want to rollback. Here are the steps to achieve this:
Identify the Migration File: Determine the specific migration file you want to rollback. For example, let's say the file is 2014_10_12_100000_create_password_resets_table.php
.
Run the Rollback Command: Use the --path
option with the php artisan migrate:rollback
command to specify the path to the migration file. The command would look like this:
php artisan migrate:rollback --path=/database/migrations/2014_10_12_100000_create_password_resets_table.php
This command will rollback only the specified migration file without affecting other migrations[1][2][3].
If you want to rollback the 2014_10_12_100000_create_password_resets_table
migration, you would run:
php artisan migrate:rollback --path=/database/migrations/2014_10_12_100000_create_password_resets_table.php
This command will rollback the specified migration and leave the rest of the migrations untouched[2].
middle
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào