From 90cdac7468747d049f9de0371ea5b9bd8ab5892d Mon Sep 17 00:00:00 2001 From: Patrick Plate Date: Wed, 17 Jun 2026 21:45:09 +0200 Subject: [PATCH] fix: revert V27 checksum + add V35 for generated_reports timestamps V27 was modified after it was applied on production, causing a Flyway checksum mismatch. Reverted V27 to original and moved the created_at/ updated_at columns to a new V35 migration. --- .../main/resources/db/migration/V27__generated_reports.sql | 4 +--- .../db/migration/V35__generated_reports_add_timestamps.sql | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 cannamanage-api/src/main/resources/db/migration/V35__generated_reports_add_timestamps.sql diff --git a/cannamanage-api/src/main/resources/db/migration/V27__generated_reports.sql b/cannamanage-api/src/main/resources/db/migration/V27__generated_reports.sql index efc1e0e..83c028e 100644 --- a/cannamanage-api/src/main/resources/db/migration/V27__generated_reports.sql +++ b/cannamanage-api/src/main/resources/db/migration/V27__generated_reports.sql @@ -10,9 +10,7 @@ CREATE TABLE generated_reports ( storage_path VARCHAR(500), parameters JSONB, generated_by UUID NOT NULL REFERENCES users(id), - generated_at TIMESTAMP DEFAULT NOW(), - created_at TIMESTAMP DEFAULT NOW(), - updated_at TIMESTAMP DEFAULT NOW() + generated_at TIMESTAMP DEFAULT NOW() ); CREATE INDEX idx_generated_reports_tenant ON generated_reports(tenant_id); diff --git a/cannamanage-api/src/main/resources/db/migration/V35__generated_reports_add_timestamps.sql b/cannamanage-api/src/main/resources/db/migration/V35__generated_reports_add_timestamps.sql new file mode 100644 index 0000000..10bdd9c --- /dev/null +++ b/cannamanage-api/src/main/resources/db/migration/V35__generated_reports_add_timestamps.sql @@ -0,0 +1,3 @@ +-- Add created_at and updated_at to generated_reports (split from V27 to avoid checksum mismatch) +ALTER TABLE generated_reports ADD COLUMN IF NOT EXISTS created_at TIMESTAMP DEFAULT NOW(); +ALTER TABLE generated_reports ADD COLUMN IF NOT EXISTS updated_at TIMESTAMP DEFAULT NOW();