Currently, the script only applies migrations newer than the latest migration applied in the database. This causes issues for developers who apply newer migrations before older ones, like when you merge an older branch into a newer one that's already been migrated.
Example:
I have master with migrations 100, 200, and 300. Someone forks this branch and creates migration 400, but before they're finished working on their branch, I've already created migration 500 and pushed it to production. When their fork is merged back into master, migration 400 will never be applied because I've already applied 500. This is an issue.
I wasn't sure what the best behavior is in this scenario. Maybe the script should always apply migrations less than the highest applied migration, even when downgrading the database. This fix works for my uses though, and I may extend it in the future.
New behavior:
When upgrading the database, all unapplied migrations will be included in the upgrade. Entering a limiting argument will limit these steps as normal.
Currently, the script only applies migrations newer than the latest migration applied in the database. This causes issues for developers who apply newer migrations before older ones, like when you merge an older branch into a newer one that's already been migrated.
Example:
I have
master
with migrations100
,200
, and300
. Someone forks this branch and creates migration400
, but before they're finished working on their branch, I've already created migration500
and pushed it to production. When their fork is merged back intomaster
, migration400
will never be applied because I've already applied500
. This is an issue.I wasn't sure what the best behavior is in this scenario. Maybe the script should always apply migrations less than the highest applied migration, even when downgrading the database. This fix works for my uses though, and I may extend it in the future.
New behavior: When upgrading the database, all unapplied migrations will be included in the upgrade. Entering a limiting argument will limit these steps as normal.