From ec2bbccdbda80df8b927ed06ce5c19d06fef7628 Mon Sep 17 00:00:00 2001 From: Sacha Al Himdani Date: Wed, 20 May 2026 12:46:54 +0200 Subject: [PATCH] Rename snapshot cleanup migration and use third_parties table Signed-off-by: Sacha Al Himdani --- .../{20260506T150405Z.sql => 20260520T104358Z.sql} | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename pkg/coredata/migrations/{20260506T150405Z.sql => 20260520T104358Z.sql} (70%) diff --git a/pkg/coredata/migrations/20260506T150405Z.sql b/pkg/coredata/migrations/20260520T104358Z.sql similarity index 70% rename from pkg/coredata/migrations/20260506T150405Z.sql rename to pkg/coredata/migrations/20260520T104358Z.sql index 15f46930f..5ceab7a32 100644 --- a/pkg/coredata/migrations/20260506T150405Z.sql +++ b/pkg/coredata/migrations/20260520T104358Z.sql @@ -17,14 +17,14 @@ -- table, controls_snapshots, snapshots_type enum, snapshot-scoped indexes) is -- dropped in a follow-up migration. --- processing_activity_vendors stores snapshot_id without an FK to snapshots, so --- the cascade delete below would not reach it. Clean it up explicitly first. -DELETE FROM processing_activity_vendors WHERE snapshot_id IS NOT NULL; +-- processing_activity_third_parties stores snapshot_id without an FK to snapshots, +-- so the cascade delete below would not reach it. Clean it up explicitly first. +DELETE FROM processing_activity_third_parties WHERE snapshot_id IS NOT NULL; -- Every other table with a snapshot_id has a FOREIGN KEY (snapshot_id) REFERENCES -- snapshots(id) ON DELETE CASCADE, so deleting all snapshots removes every --- snapshot-scoped row across data, vendors, assets, risks, findings, obligations, --- processing_activities, statements_of_applicability, applicability_statements, --- the vendor_* sub-tables, the processing_activity DPIA/TIA tables, and the --- controls_snapshots junction. +-- snapshot-scoped row across data, third_parties, assets, risks, findings, +-- obligations, processing_activities, statements_of_applicability, +-- applicability_statements, the third_party_* sub-tables, the processing_activity +-- DPIA/TIA tables, and the controls_snapshots junction. DELETE FROM snapshots;