From 2beb10ddd43fd407babf329b28294d44abccaeba Mon Sep 17 00:00:00 2001 From: Gunnar Velle Date: Fri, 12 Dec 2025 08:34:53 +0100 Subject: [PATCH] Add migration to set nodetype case for specified levels --- .gitignore | 1 + src/main/resources/db-master-changelog.xml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index c1e614e1..097205f9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ target *.backup .env +.env.* .yarn/ # Elastic Beanstalk Files diff --git a/src/main/resources/db-master-changelog.xml b/src/main/resources/db-master-changelog.xml index dd6b82d0..78682c04 100644 --- a/src/main/resources/db-master-changelog.xml +++ b/src/main/resources/db-master-changelog.xml @@ -861,4 +861,22 @@ + + + UPDATE node n + SET node_type = 'CASE', public_id = 'urn:case:' || n.ident + WHERE n.id IN ( + SELECT nc.child_id + FROM node_connection nc + JOIN node n1 ON nc.parent_id = n1.id + JOIN node_connection nc2 ON n1.id = nc2.child_id + JOIN node n2 ON nc2.parent_id = n2.id + JOIN node_connection nc3 ON n2.id = nc3.child_id + JOIN node n3 ON nc3.parent_id = n3.id + WHERE n3.public_id = 'urn:subject:d1fe9d0a-a54d-49db-a4c2-fd5463a7c9e7' AND n2.node_type = 'TOPIC' AND n1.node_type = 'TOPIC' + AND nc.connection_type = 'BRANCH' AND nc2.connection_type = 'BRANCH' AND nc3.connection_type = 'BRANCH' + ); + + +