diff --git a/CHANGELOG.md b/CHANGELOG.md index 7208f72..7a5ec9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Add a service to manage organisation's their scope of operation [OP-3205] - datamodel: Allow a location to be within multiple other locations [OP-3205] - datafix: set scope of operation for worship administrative units [OP-3626] +- Clean dev addresses linked to both sites and contact points of mandatarissen [DL-6701] ### Deploy notes ``` drc pull scope-of-operation; drc up -d scope-of-operation @@ -32,7 +33,6 @@ drc restart migrations; drc logs -ft --tail=200 migrations - Add URI to resource's organization responses - Fix query for organizations report [OP-3636] - Bump report-generation-service to most recent version -- Write migration to harmonize date formats of change events [OP-3559] ### Deploy notes ``` drc pull deltanotifier; drc up -d deltanotifier diff --git a/config/dev-migrations/20250708142100-fix-same-address-linked-to-both-site-and-contact-point.sparql b/config/dev-migrations/20250708142100-fix-same-address-linked-to-both-site-and-contact-point.sparql new file mode 100644 index 0000000..24d41a3 --- /dev/null +++ b/config/dev-migrations/20250708142100-fix-same-address-linked-to-both-site-and-contact-point.sparql @@ -0,0 +1,31 @@ +DELETE { + GRAPH ?h { + ?site ?oldAddressUri . + } +} INSERT { + GRAPH ?g { + ?newAddressUri a ; + ?newAddressUuid ; + ?p ?o . + } + + GRAPH ?h { + ?site ?newAddressUri . + } +} WHERE { + GRAPH ?g { + ?oldAddressUri a ; + ?p ?o . + + FILTER (?p NOT IN ()) + } + + ?mandatarisContact ?oldAddressUri . + + GRAPH ?h { + ?site ?oldAddressUri . + } + + BIND(MD5(CONCAT(?oldAddressUri,"OLD_ADDRESS")) AS ?newAddressUuid) . + BIND(IRI(CONCAT("http://data.lblod.info/id/adressen/", STR(?newAddressUuid))) AS ?newAddressUri) . +}