From eb7d8949cdf73707e648aed555b6ec66ac868f91 Mon Sep 17 00:00:00 2001 From: Riad Abdallah Date: Thu, 8 May 2025 16:26:52 +0200 Subject: [PATCH 1/2] Remove Active Organization from Inactive CKB Deinze There is a 'double' instance of CKB Deinze in the database. One is active, and the other is inactive. This confuses systems, and it doesn't make sense that active organizations are linked (almost managed) by an inactive organization. * Insert suborganization(s) belonging to non-active org to the active one * Insert new membership belonging to the suborganization(s) and active org * Delete memberships for non-active org --- ...ganization-from-inactive-ckb-deinze.sparql | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 config/migrations-triggering-indexing/2025/20250429103515-remove-has-suborganization-from-inactive-ckb-deinze.sparql diff --git a/config/migrations-triggering-indexing/2025/20250429103515-remove-has-suborganization-from-inactive-ckb-deinze.sparql b/config/migrations-triggering-indexing/2025/20250429103515-remove-has-suborganization-from-inactive-ckb-deinze.sparql new file mode 100644 index 0000000..72fe5eb --- /dev/null +++ b/config/migrations-triggering-indexing/2025/20250429103515-remove-has-suborganization-from-inactive-ckb-deinze.sparql @@ -0,0 +1,55 @@ +PREFIX org: +PREFIX mu: + +INSERT { + GRAPH { + ?activeOrg + ?sub . + + ?membership a org:Membership ; + mu:uuid ?uuid ; + org:organization ?activeOrg ; + org:member ?sub ; + org:role . + } +} +WHERE { + BIND( AS ?inactiveOrg) + BIND( AS ?activeOrg) + + GRAPH { + ?inactiveOrg + ?sub . + } + + FILTER NOT EXISTS { + ?activeOrg + ?sub . + } + + BIND(SHA1(CONCAT(STR(?activeOrg), STR(?sub), "sub organization")) as ?uuid) + BIND(IRI(CONCAT("http://data.lblod.info/id/lidmaatschap/", ?uuid)) AS ?membership) +} + +; + +DELETE { + GRAPH { + ?inactiveOrg + ?sub . + + ?membership ?membershipP ?membershipO . + } +} +WHERE { + BIND( AS ?inactiveOrg) + + GRAPH { + ?inactiveOrg + ?sub . + + ?membership a org:Membership ; + org:organization ?inactiveOrg ; + ?membershipP ?membershipO . + } +} From 464da76876a5cdaa29fb538069e9251ed59fb383 Mon Sep 17 00:00:00 2001 From: Riad Abdallah Date: Thu, 8 May 2025 16:27:34 +0200 Subject: [PATCH 2/2] Release v1.31.3 --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 919422f..666eea9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ # Changelog +## v1.31.3 (2025-05-08) +### Backend + - Migrate active organizations linked to inactive CKB to the active one. [DL-6604] +### Deploy notes +``` +drc restart migrations-triggering-indexing && drc logs -ft --tail=200 migrations-triggering-indexing +``` + ## v1.31.2 (2025-04-02) ### Backend - Extend the public producer to include: [CLBV-980] @@ -61,7 +69,7 @@ Before we can generate a user we need to add an application salt to the server. Once this is done you can generate a user by running `mu script project-scripts generate-dashboard-login` and following the prompts. A new local migration will be generated which can be run by restarting the migrations service and which will insert the new user into the database. -Store the login credentials as a comment in the docker-compose.override.yml file. +Store the login credentials as a comment in the docker-compose.override.yml file. ##### 3. (Re)start the needed services `drc up -d frontend-dashboard dashboard-login identifier; drc restart dispatcher resource db`