From f3e426f3cf2972ea64e5c16782ebec5ce70fefca Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Sat, 12 Oct 2024 21:08:43 +0000
Subject: [PATCH] Hotfix cascade

---
 dbrepo-metadata-db/1_setup-schema.sql         | 2 +-
 helm/dbrepo/templates/metadata-configmap.yaml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dbrepo-metadata-db/1_setup-schema.sql b/dbrepo-metadata-db/1_setup-schema.sql
index db90e94c1f..34ccd4304f 100644
--- a/dbrepo-metadata-db/1_setup-schema.sql
+++ b/dbrepo-metadata-db/1_setup-schema.sql
@@ -372,7 +372,7 @@ CREATE TABLE IF NOT EXISTS `mdb_view_columns`
     auto_generated   BOOLEAN                  DEFAULT false,
     is_null_allowed  BOOLEAN         NOT NULL DEFAULT true,
     PRIMARY KEY (id),
-    FOREIGN KEY (view_id) REFERENCES mdb_view (id)
+    FOREIGN KEY (view_id) REFERENCES mdb_view (id) ON DELETE CASCADE
 ) WITH SYSTEM VERSIONING;
 
 CREATE TABLE IF NOT EXISTS `mdb_identifiers`
diff --git a/helm/dbrepo/templates/metadata-configmap.yaml b/helm/dbrepo/templates/metadata-configmap.yaml
index c5d93fc4a1..893f255627 100644
--- a/helm/dbrepo/templates/metadata-configmap.yaml
+++ b/helm/dbrepo/templates/metadata-configmap.yaml
@@ -389,7 +389,7 @@ data:
         auto_generated   BOOLEAN                  DEFAULT false,
         is_null_allowed  BOOLEAN         NOT NULL DEFAULT true,
         PRIMARY KEY (id),
-        FOREIGN KEY (view_id) REFERENCES mdb_view (id)
+        FOREIGN KEY (view_id) REFERENCES mdb_view (id) ON DELETE CASCADE
     ) WITH SYSTEM VERSIONING;
 
     CREATE TABLE IF NOT EXISTS `mdb_identifiers`
-- 
GitLab