fix(coderd/database): renumber duplicate migration 000596 to 000597 - #29568
Merged
Merged
Conversation
Two migrations landed on main with the same number 000596, which makes golang-migrate fail to initialize with "duplicate migration file". Renumber the AI Gateway workspace context migration to 000597.
ibetitsmike
approved these changes
Sep 18, 2026
Member
|
Thanks @ibetitsmike ❤️ |
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.
Two migrations landed on
mainwith the same number:000596_template_usage_stats_session_usage.{up,down}.sql(feat: store session usage per app and family in template usage stats #29109)000596_aibridge_workspace_context.{up,down}.sql(feat: attribute AI Gateway usage to workspaces #29235)This makes golang-migrate fail to initialize the source driver:
Every job that touches the database is failing on
mainas a result (gen, sqlc-vet, E2E, offline docs lint, PostgreSQL 17, Linux/macOS/Windows test suites, race), pluscoderd/database/gen/dump/main.gopanics.This renames the later-merged AI Gateway migration to
000597. The SQL content is unchanged — it is a pure rename, so no schema dump or fixture regeneration is required.migration000596_test.goand thetestdata/fixtures/000596_template_usage_stats_session_usage.up.sqlfixture belong to the earlier migration and are untouched.Verified the source driver now initializes and resolves
597as the final version.Created on behalf of @ibetitsmike
cc @johnstcn @EhabY