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
Unfortunately an incorrect migration is still returned in the following scenario:
There are more than Take migrations (defaults to 100)
All migrations are applied onto an empty database in a single run of MigrationEnginge.MigrateAsync(). All of the corresponding MigrationInfos are assigned the same time stamp
During the next run of the MigrationEngine it is up to the database engine to determine the order as the AppliedAt values of all MigrationInfos are equal. In the case of MSSQL Server the first Take migrations are returned, not the last. Consequently, migration #Take is incorrectly identified as the last one and the engine tries to reapply the remaining migrations starting from Take + 1.
Possible Workarounds
Use different timestamps for every pending migration. This does not solve the problem for existing databases, though.
Order by the AppliedAt AND the Id column. This workaround depends on the ID generation for the MigrationInfos table.
The text was updated successfully, but these errors were encountered:
Description
PR #8 solved #7 by correctly querying the most recently applied MigrationInfo in descending order:
Unfortunately an incorrect migration is still returned in the following scenario:
Take
migrations (defaults to 100)MigrationEnginge.MigrateAsync()
. All of the corresponding MigrationInfos are assigned the same time stampAppliedAt
values of allMigrationInfos
are equal. In the case of MSSQL Server the firstTake
migrations are returned, not the last. Consequently, migration #Take
is incorrectly identified as the last one and the engine tries to reapply the remaining migrations starting fromTake + 1
.Possible Workarounds
AppliedAt
AND theId
column. This workaround depends on the ID generation for the MigrationInfos table.The text was updated successfully, but these errors were encountered: