fix(coderd/database/migrations): resolve duplicate 000554 migration collision (#27581)

> 🤖 This PR was written by Coder Agents on behalf of Jake Howell.

## Problem

`main` currently has **two migrations sharing version `000554`**:

- `000554_aibridge_token_usage_spend_export_index.{up,down}.sql`
- `000554_legacy_none_login_to_password.{up,down}.sql` (from #26851)

Both merged around the same time. #26851 was renumbered to `000554` when
`000553` was the latest, but `aibridge_token_usage_spend_export_index`
claimed `000554` and merged too, leaving a duplicate version number on
`main`. Duplicate migration versions break the migration sequence.

## Fix

Renumber the legacy none login migration to the next free slot,
`000555`, leaving the aibridge migration at `000554`:

- `000554_legacy_none_login_to_password.{up,down}.sql` ->
`000555_legacy_none_login_to_password.{up,down}.sql`
- `migrate_test.go`: `TestMigration000554...` ->
`TestMigration000555...`, `priorMigrationVersion` `553` -> `554`, and
the `os.ReadFile` filename.

The migration is data-only and unchanged; only its version number moves.
`TestMigration000555LegacyNoneLoginToPassword` passes locally.

The same collision exists on `release/2.36` via the backport (#27578),
which has been renumbered to `000555` to match.

Resolves [DEVEX-226] follow-up.

[DEVEX-226]: https://linear.app/issue/DEVEX-226
This commit is contained in:
Jake Howell
2026-07-28 11:35:36 +00:00
committed by GitHub
parent 2dc850d085
commit bd5d640f1e
3 changed files with 3 additions and 3 deletions
+3 -3
View File
@@ -1717,10 +1717,10 @@ func TestMigration000546ChatHistoryAPIKeyConstraints(t *testing.T) {
}
}
func TestMigration000554LegacyNoneLoginToPassword(t *testing.T) {
func TestMigration000555LegacyNoneLoginToPassword(t *testing.T) {
t.Parallel()
const priorMigrationVersion = 553
const priorMigrationVersion = 554
sqlDB := testSQLDB(t)
@@ -1772,7 +1772,7 @@ func TestMigration000554LegacyNoneLoginToPassword(t *testing.T) {
passwordID, "password-user", "password@test.com", []byte("hashed"), now, now, "active", pq.StringArray{}, "password", false, false)
require.NoError(t, err)
migrationSQL, err := os.ReadFile("000554_legacy_none_login_to_password.up.sql")
migrationSQL, err := os.ReadFile("000555_legacy_none_login_to_password.up.sql")
require.NoError(t, err)
_, err = sqlDB.ExecContext(ctx, string(migrationSQL))
require.NoError(t, err)