fix(coderd/database/migrations): resolve duplicate 000554 migration collision - #27581
Merged
Merged
Conversation
… collision Both 000554_aibridge_token_usage_spend_export_index and 000554_legacy_none_login_to_password landed on main with the same version number. Renumber the legacy none login migration to 000555 and update migrate_test.go accordingly.
jakehwll
marked this pull request as ready for review
July 28, 2026 11:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
maincurrently has two migrations sharing version000554:000554_aibridge_token_usage_spend_export_index.{up,down}.sql000554_legacy_none_login_to_password.{up,down}.sql(from fix!: deprecatelogin_type=none, convert existing users to password login #26851)Both merged around the same time. #26851 was renumbered to
000554when000553was the latest, butaibridge_token_usage_spend_export_indexclaimed000554and merged too, leaving a duplicate version number onmain. Duplicate migration versions break the migration sequence.Fix
Renumber the legacy none login migration to the next free slot,
000555, leaving the aibridge migration at000554:000554_legacy_none_login_to_password.{up,down}.sql->000555_legacy_none_login_to_password.{up,down}.sqlmigrate_test.go:TestMigration000554...->TestMigration000555...,priorMigrationVersion553->554, and theos.ReadFilefilename.The migration is data-only and unchanged; only its version number moves.
TestMigration000555LegacyNoneLoginToPasswordpasses locally.The same collision exists on
release/2.36via the backport (#27578), which has been renumbered to000555to match.Resolves DEVEX-226 follow-up.