Closed clphillips closed 8 years ago
I'm not sure I follow, I thought the lib would run through any migrations that haven't been run yet?
davem@wes:www:master$ phpmig status
Status Migration ID Migration Name
-----------------------------------------
up 20160106201419 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160108115524 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160113120751 XXXXXXXXXXXXXXXXXXXXXXXXXx
down 20160114080443 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160115224616 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160119100302 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160119210838 XXXXXXXXXXXXXXXXXXXXXXXXXx
down 20160126110050 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160129212040 XXXXXXXXXXXXXXXXXXXXXXXXXx
down 20160129222803 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160205213320 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160205213517 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160223200704 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160308212217 XXXXXXXXXXXXXXXXXXXXXXXXXx
up 20160309150225 XXXXXXXXXXXXXXXXXXXXXXXXXx
davem@wes:www.childcare.co.uk:master$ phpmig migrate
== 20160114080443 XXXXXXXXXXXXXXXXXXXXXXXXXx migrating
== 20160114080443 XXXXXXXXXXXXXXXXXXXXXXXXXx migrated 0.0050s
== 20160126110050 XXXXXXXXXXXXXXXXXXXXXXXXXx migrating
== 20160126110050 XXXXXXXXXXXXXXXXXXXXXXXXXx migrated 0.0047s
== 20160129222803 XXXXXXXXXXXXXXXXXXXXXXXXXx migrating
== 20160129222803 XXXXXXXXXXXXXXXXXXXXXXXXXx migrated 0.0068s
davem@wes:www.childcare.co.uk:master$
Probably @clphillips have migrations that depend one on another and wants them to run in order they were created.
But if they depended on each other, how could they later migrations have been run already...?
Then I guessed wrong maybe.
Hm... My previous testing has shown that only migrations after the latest stored migration are run when performing phpmig migrate
. I'll see if I can duplicate, because it would be super sweet if any and all un-run migrations are run during phpmig migrate
.
Awesome! Previous un-run migration are run during phpmig migrate
. Not sure why I was having trouble before. Maybe I ran into a database error during the migration or something.
One huge improvement to migration handling when you're dealing with pull requests which may be merged out of order is the ability to run migrations out of order.
What does that mean exactly? It means finding and sorting all migrations which exist but have not been processed, then processing those migrations (in order).
For example. Assume we have the following migrations in our database
Now suppose we merge a new migration in. It's called
20160315060000_SomeTask.php
. We can't run it. Instead we have to rollback to20160315000000
, then migrate forward again. This is a huge pain.With a setting (disabled by default) allowing any migration to be processed that hasn't been processed we'd have: