Issue
So, let's say on the first of this month, I create branch A, with a migration file named 2020_04_01_113108_modify_request_logs_table.php
But let's say I don't merge this branch into my Master branch yet, and then I start working on branch B 2 days later, with a migration file named 2020_04_03_113108_create_label_logs_table.php
So on the 4th, I merge branch B into master and run php artisan migrate
, and it runs the second migration.
And then on the 6th, I'm finally ready to merge branch A into master and run php artisan migrate
. Is there anything that's going to go wrong with this migration? Does the migration system care that the dates of the files happened out of order? Will it ignore the A-branch file because it's already run a migration with a date later than that file?
Solution
Migration that haven't been executed yet, will be.
To check this before hand, you can run php artisan migrate:status
to see which one are already executed ('Yes') and the ones that aren't ('No').
The output will look like this:
+------+-------------------------------------------------------------------+-------+
| Ran? | Migration | Batch |
+------+-------------------------------------------------------------------+-------+
| Yes | 2019_12_12_184629_create_users_table | 1 |
| Yes | 2020_03_27_153830_create_another_table | 1 |
| No | 2020_04_01_090622_modify_user_table | |
| Yes | 2020_04_11_102846_update_level | 1 |
| No | 2020_04_22_094132_dummy_migration | |
+------+-------------------------------------------------------------------+-------+
Answered By - Arnaud B Answer Checked By - Timothy Miller (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.