From e6f9d7aae23697737217668811c7dc42a81db956 Mon Sep 17 00:00:00 2001 From: Sacha Al Himdani Date: Tue, 17 Feb 2026 15:11:16 +0100 Subject: [PATCH] Clean up database Signed-off-by: Sacha Al Himdani --- pkg/coredata/migrations/20260213T120000Z.sql | 2 -- pkg/coredata/migrations/20260217T120000Z.sql | 5 ----- pkg/coredata/migrations/20260217T130000Z.sql | 6 ++++++ 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 pkg/coredata/migrations/20260217T130000Z.sql diff --git a/pkg/coredata/migrations/20260213T120000Z.sql b/pkg/coredata/migrations/20260213T120000Z.sql index f06726696..40962810a 100644 --- a/pkg/coredata/migrations/20260213T120000Z.sql +++ b/pkg/coredata/migrations/20260213T120000Z.sql @@ -39,5 +39,3 @@ WHERE approver_profile_id IS NOT NULL; -- Allow NULL on old columns now that data is in the join tables ALTER TABLE document_versions ALTER COLUMN approver_profile_id DROP NOT NULL; - --- TODO: Drop the old columns diff --git a/pkg/coredata/migrations/20260217T120000Z.sql b/pkg/coredata/migrations/20260217T120000Z.sql index 62bdc95ef..f7721d36f 100644 --- a/pkg/coredata/migrations/20260217T120000Z.sql +++ b/pkg/coredata/migrations/20260217T120000Z.sql @@ -1,6 +1 @@ ALTER TABLE controls ALTER COLUMN status DROP NOT NULL; - --- TODO: drop columns and type once all code references are fully removed --- ALTER TABLE controls DROP COLUMN status; --- ALTER TABLE controls DROP COLUMN exclusion_justification; --- DROP TYPE control_status; diff --git a/pkg/coredata/migrations/20260217T130000Z.sql b/pkg/coredata/migrations/20260217T130000Z.sql new file mode 100644 index 000000000..6bae9c56c --- /dev/null +++ b/pkg/coredata/migrations/20260217T130000Z.sql @@ -0,0 +1,6 @@ +ALTER TABLE documents DROP COLUMN approver_profile_id; +ALTER TABLE document_versions DROP COLUMN approver_profile_id; + +ALTER TABLE controls DROP COLUMN status; +ALTER TABLE controls DROP COLUMN exclusion_justification; +DROP TYPE control_status;