Closed the-yadu closed 7 years ago
Umm no. In my understanding, the numbers assigned should work like a story line. So it should always execute in increasing order. Let me give you another scenario:
abc
unmerged branch)If at a later date, abc
is merged with master branch, do you expect the 4_update_table1.js
to run smoothly? Definitely No.
Before you decide to add a migration, you need to fetch and merge the master branch, execute all the migrations and only then add your new migrations to avoid a collision.
According to my understanding, it should run all the pending migrations because every time I commit the code I have to pull changes, which will bring the 5_drop_table1.js into my local. Now If I run migrations on my local it should drop my table.(5_drop_table1.js) Now it should be my headache to fix my 4_update_table1.js and then commit the code.
Correct me If I am wrong.
And 1 more request. Please console out the output of migrations run. Thanks for making this. I needed it.
I went through few other migration managers and your concern is a valid one. Unfortunately, I cannot address this issue in the current version. This also means that no new version will be published for this major version. Version 2.0.0 will have this feature along with few other fixes related to logging etc.
I will also include an extra script to migrate from v1.x.x to v2.
Will try to publish it in a week. Thanks
This has been fixed.
I have 2 migrations
Migration y_table was created before the x_table but was committed later.
With every deploy in production, we have a script to run migrations up. So Y_table migration was executed first
Later I committed x_table migration, and the ran the migration command again with deploy. The x_table migration is not getting executed. The table in MySQL does not contain the row of x_table migration.
Is the migrations execution depends only on time? Ideally, it should execute all the pending migrations, right?