diff --git a/CHANGELOG.md b/CHANGELOG.md index c706de0..ada5e52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,14 @@ drc exec delta-producer-background-jobs-initiator curl -X POST http://localhost/ drc exec delta-producer-background-jobs-initiator curl -X POST http://localhost/organizations/healing-jobs # or wait until nightly healing kicks in ``` +## 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] @@ -82,7 +90,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` 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 . + } +}