Skip to content

fix(db): duplicate migration version 000057 on base (cleanup_universal_plans vs drop_user_role_to_groups) #970

Description

@cristim

Confirmed: duplicate migration version 000057 on base

origin/feat/multicloud-web-frontend carries TWO distinct migrations at version 000057:

golang-migrate requires unique, monotonic versions. Impact:

Decision needed (deployed-DB state)

Unlike the earlier collisions (which surfaced while deploys were already failing), deploys have been SUCCEEDING here (/version live at git_sha 83d5dc8), so one of these 000057 migrations may already be applied to the QA (and/or prod) database. That makes a naive git mv renumber risky: the DB's schema_migrations would still record 000057 as applied, and renaming the file to a higher number makes migrate see a "missing" 000057 plus a "new" higher version.

Options:

  1. If neither 000057 is applied yet on any live DB: git mv the later / less-foundational one (cleanup_universal_plans) to the next free slot (000060; base jumps 000059 -> 000063, so 000060/61/62 are free), update its _test.go, done.
  2. If one IS applied: reconcile schema_migrations on the live DB(s) and use a relocate-style approach (mirror what 000064/bug(auth/seed): Purchaser group never seeded -- UUID collision with Standard Users (migrations 000057 vs 000059) #942 did for the Purchaser group) so the renumber is idempotent and doesn't re-run or strand state.

Ask

Which 000057 (if either) has been applied to the QA/prod DB? With that, I can land the correct fix (renumber vs reconcile-and-relocate). Do NOT renumber blindly until this is known.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mDaysimpact/all-usersAffects every userpr-createdA PR has been opened for this issue (dedup guard for the auto-PR loop)pr-mergedThe PR for this issue has been mergedpriority/p1Next up; this sprintseverity/highSignificant harmtriagedItem has been triagedtype/bugDefecturgency/nowDrop other things

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions