From 81bcb1c1ef7e5e222f7e97891e22825d89042deb Mon Sep 17 00:00:00 2001 From: Nora Date: Mon, 22 Jun 2026 16:06:54 -0600 Subject: [PATCH] fix(db): renumber auth migrations to come after SP14/12-backups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The auth cherry-picks brought in 0010_auth_users_and_sessions.sql (version: 10) and 0011_audit_log_user_id.sql (version: 11), which collide with main's 0010_payer_rejected_acknowledged.sql (version: 10) and 0011_processed_inbound_files.sql (version: 11). The migration runner is filename-sorted but uses the -- version: N header to gate 'application vs skip', so the second file at each version gets silently skipped — claims.payer_rejected_acknowledged_at never got ALTERed, breaking every test that touches the claims table. Renumber to 0013 and 0014 (and bump the -- version headers to match) so they apply after 0012_backups.sql and main's existing SP14 / SP15 migrations. --- ..._users_and_sessions.sql => 0013_auth_users_and_sessions.sql} | 2 +- .../{0011_audit_log_user_id.sql => 0014_audit_log_user_id.sql} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename backend/src/cyclone/migrations/{0010_auth_users_and_sessions.sql => 0013_auth_users_and_sessions.sql} (93%) rename backend/src/cyclone/migrations/{0011_audit_log_user_id.sql => 0014_audit_log_user_id.sql} (82%) diff --git a/backend/src/cyclone/migrations/0010_auth_users_and_sessions.sql b/backend/src/cyclone/migrations/0013_auth_users_and_sessions.sql similarity index 93% rename from backend/src/cyclone/migrations/0010_auth_users_and_sessions.sql rename to backend/src/cyclone/migrations/0013_auth_users_and_sessions.sql index d8329eb..6401d7b 100644 --- a/backend/src/cyclone/migrations/0010_auth_users_and_sessions.sql +++ b/backend/src/cyclone/migrations/0013_auth_users_and_sessions.sql @@ -1,4 +1,4 @@ --- version: 10 +-- version: 13 -- Auth (SP-auth): users + sessions tables. -- -- `users` holds the local credential store: bcrypt-hashed password, diff --git a/backend/src/cyclone/migrations/0011_audit_log_user_id.sql b/backend/src/cyclone/migrations/0014_audit_log_user_id.sql similarity index 82% rename from backend/src/cyclone/migrations/0011_audit_log_user_id.sql rename to backend/src/cyclone/migrations/0014_audit_log_user_id.sql index a69a9d8..76dcd55 100644 --- a/backend/src/cyclone/migrations/0011_audit_log_user_id.sql +++ b/backend/src/cyclone/migrations/0014_audit_log_user_id.sql @@ -1,4 +1,4 @@ --- version: 11 +-- version: 14 -- Auth (SP-auth): record the acting user_id on every audit_log entry. -- -- Backwards-compatible: existing rows get NULL user_id (they were