From 706b7fa52558acba83fe612477e27c289408baa9 Mon Sep 17 00:00:00 2001 From: mirdono Date: Wed, 30 Apr 2025 19:43:02 +0200 Subject: [PATCH] chore: move memberships from shared to administrative-unit graph These memberships can be edited by users via the related organisations page. If this data is kept in the read-only shared graph this leads to unexpected behaviour when users (try to) remove such a membership. More specifically, as the user has no write acces to the graph the request will be silently ignored and the "removed" data will simply reappear after saving the form. --- CHANGELOG.md | 1 + ...om-shared-to-administrative-unit-graph.sparql | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 config/migrations/2025/20250430174011-chore--move-memberships-from-shared-to-administrative-unit-graph.sparql diff --git a/CHANGELOG.md b/CHANGELOG.md index 635873e..e59f301 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix KBO statuses not being displayed [OP-3584] - datafix: update NIS2019 end dates and link additional NIS2025 to werkingsgebieden [part of OP-3566] - datafix: correct date of change event of ckb olen [OP-3594] +- datafix: move memberships from shared to administrative unit graph ### Deploy Notes ``` drc restart migrations; drc logs -ft --tail=200 migrations diff --git a/config/migrations/2025/20250430174011-chore--move-memberships-from-shared-to-administrative-unit-graph.sparql b/config/migrations/2025/20250430174011-chore--move-memberships-from-shared-to-administrative-unit-graph.sparql new file mode 100644 index 0000000..9c66004 --- /dev/null +++ b/config/migrations/2025/20250430174011-chore--move-memberships-from-shared-to-administrative-unit-graph.sparql @@ -0,0 +1,16 @@ +PREFIX org: + +DELETE { + GRAPH { + ?membership ?p ?o . + } +} INSERT { + GRAPH { + ?membership ?p ?o . + } +} WHERE { + GRAPH { + ?membership a org:Membership ; + ?p ?o . + } +}