From 5894580f3c68ae8c6361bbe1ed2cd785f61dabc9 Mon Sep 17 00:00:00 2001 From: Cristian Magherusan-Stanciu Date: Fri, 19 Jun 2026 16:52:55 +0200 Subject: [PATCH] fix(db): renumber audit_actor_stamps migration 074->077 to clear collision PR #1011 added 000074_audit_actor_stamps while prod already has 000074_repair_partial_migration_058_067 applied and recorded in schema_migrations. The duplicate caused "CI - Build & Test / Integration Tests" to fail at "Run database migrations" with duplicate migration file error. Keep the repair at 074 (prod-applied) and move the new audit stamp migration to 077 (next free slot). --- ...actor_stamps.down.sql => 000077_audit_actor_stamps.down.sql} | 2 +- ...dit_actor_stamps.up.sql => 000077_audit_actor_stamps.up.sql} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename internal/database/postgres/migrations/{000074_audit_actor_stamps.down.sql => 000077_audit_actor_stamps.down.sql} (87%) rename internal/database/postgres/migrations/{000074_audit_actor_stamps.up.sql => 000077_audit_actor_stamps.up.sql} (93%) diff --git a/internal/database/postgres/migrations/000074_audit_actor_stamps.down.sql b/internal/database/postgres/migrations/000077_audit_actor_stamps.down.sql similarity index 87% rename from internal/database/postgres/migrations/000074_audit_actor_stamps.down.sql rename to internal/database/postgres/migrations/000077_audit_actor_stamps.down.sql index 07e811f8d..240531f7f 100644 --- a/internal/database/postgres/migrations/000074_audit_actor_stamps.down.sql +++ b/internal/database/postgres/migrations/000077_audit_actor_stamps.down.sql @@ -1,4 +1,4 @@ --- Rollback migration 000074: remove audit actor stamp columns. +-- Rollback migration 000077: remove audit actor stamp columns. -- The FK constraint on transitioned_by is dropped automatically with the column. ALTER TABLE purchase_executions diff --git a/internal/database/postgres/migrations/000074_audit_actor_stamps.up.sql b/internal/database/postgres/migrations/000077_audit_actor_stamps.up.sql similarity index 93% rename from internal/database/postgres/migrations/000074_audit_actor_stamps.up.sql rename to internal/database/postgres/migrations/000077_audit_actor_stamps.up.sql index ce61e7d16..928be222e 100644 --- a/internal/database/postgres/migrations/000074_audit_actor_stamps.up.sql +++ b/internal/database/postgres/migrations/000077_audit_actor_stamps.up.sql @@ -1,4 +1,4 @@ --- Migration 000074: audit actor stamps on state transitions +-- Migration 000077: audit actor stamps on state transitions -- Adds transitioned_by + transitioned_at to the three financial state machines: -- purchase_executions, ri_exchanges (ri_exchange_history), account_registrations. -- Idempotent: uses ADD COLUMN IF NOT EXISTS throughout.