-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix migration ID #466
Fix migration ID #466
Conversation
we should not change old migration because it can be already been applied to some environments. Changing the ID will break the migration process for those envs. Having an ID that is not formatted as it should be is wrong but we didn't catch it on time and the cost of changing it is too high. I am not sure what this is |
Signed-off-by: Gaurav Gahlot <[email protected]>
d776138
to
416f8da
Compare
Codecov Report
@@ Coverage Diff @@
## master #466 +/- ##
=======================================
Coverage 35.82% 35.82%
=======================================
Files 47 47
Lines 2892 2892
=======================================
Hits 1036 1036
Misses 1763 1763
Partials 93 93
Continue to review full report at Codecov.
|
Due to incorrect ID, this migration is not applied in the correct order. This results in errors when remove |
Are you sure?! Technically the migrations are applied in the order they are appended to the slice! let's zoom so we can double check! |
This tests is coming from this PR #466 We didn't fully understood how the migration library sorts migration before having to troubleshoot that PR. Even if we declare them in order as part of the GetMigrations function the library still applies quick sort on the migration ID to stay concurrency safe https://github.com/rubenv/sql-migrate/blob/011dc47c6043b25483490739b61cabbc5da7ee9a/migrate.goL216 In order to improve the visbility and to akwnoldge that the way we append migrations to GetMigrations is the same we get after the sorting we wrote this tests.
This tests is coming from this PR #466 We didn't fully understood how the migration library sorts migration before having to troubleshoot that PR. Even if we declare them in order as part of the GetMigrations function the library still applies quick sort on the migration ID to stay concurrency safe https://github.com/rubenv/sql-migrate/blob/011dc47c6043b25483490739b61cabbc5da7ee9a/migrate.goL216 In order to improve the visbility and to akwnoldge that the way we append migrations to GetMigrations is the same we get after the sorting we wrote this tests. Signed-off-by: Gianluca Arbezzano <[email protected]>
This tests is coming from this PR #466 We didn't fully understood how the migration library sorts migration before having to troubleshoot that PR. Even if we declare them in order as part of the GetMigrations function the library still applies quick sort on the migration ID to stay concurrency safe https://github.com/rubenv/sql-migrate/blob/011dc47c6043b25483490739b61cabbc5da7ee9a/migrate.goL216 In order to improve the visbility and to akwnoldge that the way we append migrations to GetMigrations is the same we get after the sorting we wrote this tests. Signed-off-by: Gianluca Arbezzano <[email protected]>
This tests is coming from this PR #466 We didn't fully understood how the migration library sorts migration before having to troubleshoot that PR. Even if we declare them in order as part of the GetMigrations function the library still applies quick sort on the migration ID to stay concurrency safe https://github.com/rubenv/sql-migrate/blob/011dc47c6043b25483490739b61cabbc5da7ee9a/migrate.goL216 In order to improve the visbility and to akwnoldge that the way we append migrations to GetMigrations is the same we get after the sorting we wrote this tests. Signed-off-by: Gianluca Arbezzano <[email protected]>
…467) This tests is coming from this PR #466 We didn't fully understood how the migration library sorts migration before having to troubleshoot that PR. Even if we declare them in order as part of the GetMigrations function the library still applies quick sort on the migration ID to stay concurrency safe https://github.com/rubenv/sql-migrate/blob/011dc47c6043b25483490739b61cabbc5da7ee9a/migrate.goL216 In order to improve the visbility and to akwnoldge that the way we append migrations to GetMigrations is the same we get after the sorting we wrote this tests. I will start a conversation with the lib maintainer to figure out how we can improve our current workflow.
This is not solved by #467 |
Why is this needed
The PR changes the migration ID:
2020121691335-update-events-primary-key
to202012169135-update-events-primary-key
.