fix(migrations): rename PMS-4 recovery-codes migration 027 -> 029 (version collision with PMS-106) #84

Merged
YousifShkara merged 1 commit from fix/migration-027-collision into main 2026-06-05 05:19:39 +02:00
Owner

PMS-4 (PR #83) and PMS-106 (PR #80) were developed in parallel and both claimed migration version 27 (027_user_mfa_recovery_codes.sql and 027_sla_notify.sql). PMS-106 merged first; my PMS-4 PR merged on top because the two files do not conflict at the git layer, but sqlx now errors on every fresh DB with:

duplicate key value violates unique constraint "_sqlx_migrations_pkey"
Key (version)=(27) already exists.

Renumber the recovery-codes migration to 029 (next free slot after PMS-58's 028_appointment_reminders.sql). Also add IF NOT EXISTS to the ALTER TABLE so any environment that already applied the old 027 form picks up the renamed file without erroring on the duplicate column.

Verified: cargo test --test auth -> 10/10 green; whole-crate cargo test -> all green (152+ tests across all binaries).

PMS-4 (PR #83) and PMS-106 (PR #80) were developed in parallel and both claimed migration version 27 (027_user_mfa_recovery_codes.sql and 027_sla_notify.sql). PMS-106 merged first; my PMS-4 PR merged on top because the two files do not conflict at the git layer, but sqlx now errors on every fresh DB with: duplicate key value violates unique constraint "_sqlx_migrations_pkey" Key (version)=(27) already exists. Renumber the recovery-codes migration to 029 (next free slot after PMS-58's 028_appointment_reminders.sql). Also add IF NOT EXISTS to the ALTER TABLE so any environment that already applied the old 027 form picks up the renamed file without erroring on the duplicate column. Verified: cargo test --test auth -> 10/10 green; whole-crate cargo test -> all green (152+ tests across all binaries).
fix(migrations): rename PMS-4 recovery-codes migration 027 -> 029 (version collision with PMS-106)
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + compile + tests (pull_request) Successful in 2m7s
Build OCI container / Build and push mokosh-api image (push) Successful in 6m45s
7edbf13a86
PMS-4 (PR #83) and PMS-106 (PR #80) were developed in parallel and both claimed migration version 27 (027_user_mfa_recovery_codes.sql and 027_sla_notify.sql). PMS-106 merged first; my PMS-4 PR merged on top because the two files do not conflict at the git layer, but sqlx now errors on every fresh DB with:

  duplicate key value violates unique constraint "_sqlx_migrations_pkey"
  Key (version)=(27) already exists.

Renumber the recovery-codes migration to 029 (next free slot after PMS-58's 028_appointment_reminders.sql). Also add IF NOT EXISTS to the ALTER TABLE so any environment that already applied the old 027 form picks up the renamed file without erroring on the duplicate column.

Verified: cargo test --test auth -> 10/10 green; whole-crate cargo test -> all green (152+ tests across all binaries).
YousifShkara deleted branch fix/migration-027-collision 2026-06-05 05:19:40 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!84
No description provided.