You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario: I have one directory with a schema migration. I have a second directory which contains a migration for setting up integration test data.
What happens: The schema migration is run but the test data migration is not. It just ignores it. If I truncate the migrations table between the two migration runs the second will work. It seems like the tool is ignoring the name of migration and just assuming that because 1 migration has been run there must be nothing to do.
It will go though the existing migrations looking for the start point but never find it meaning nothing is applied. I think to solve this in general it would need to be a bit smarter and work based on the list of known migrations. So for example down limited to 2 wouldn't just take the two off the top, it would down the last two of the discovered migrations (even if there are newer ones in the db). It might not even be worthwhile since I guess very few people would want to have multiple directories of migrations.
Either way it could be worth noting in the README there is limitation here.
The text was updated successfully, but these errors were encountered:
Scenario: I have one directory with a schema migration. I have a second directory which contains a migration for setting up integration test data.
What happens: The schema migration is run but the test data migration is not. It just ignores it. If I truncate the migrations table between the two migration runs the second will work. It seems like the tool is ignoring the name of migration and just assuming that because 1 migration has been run there must be nothing to do.
AFAIK this bit of code is at fault:
migrate.go:407
It will go though the existing migrations looking for the start point but never find it meaning nothing is applied. I think to solve this in general it would need to be a bit smarter and work based on the list of known migrations. So for example down limited to 2 wouldn't just take the two off the top, it would down the last two of the discovered migrations (even if there are newer ones in the db). It might not even be worthwhile since I guess very few people would want to have multiple directories of migrations.
Either way it could be worth noting in the README there is limitation here.
The text was updated successfully, but these errors were encountered: