From f30fcfda224e2860dee67ed4b7657df961a1c4ec Mon Sep 17 00:00:00 2001 From: mirdono Date: Mon, 29 Apr 2024 16:31:56 +0200 Subject: [PATCH] fix: remove dangling change event results The change events related to an organisation contains some data errors: - There is a change event result without any corresponding change event. This causes an error when visiting the change events page for this organisation. - There are two identical change event results for the same change event. This causes the change event to be shown twice in the table. (Only on PROD) The added migration removes these unnecessary elements change event results. --- ...emove-dangling-change-event-results.sparql | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 config/migrations/2024/20240429134438-remove-dangling-change-event-results.sparql diff --git a/config/migrations/2024/20240429134438-remove-dangling-change-event-results.sparql b/config/migrations/2024/20240429134438-remove-dangling-change-event-results.sparql new file mode 100644 index 0000000..e305ced --- /dev/null +++ b/config/migrations/2024/20240429134438-remove-dangling-change-event-results.sparql @@ -0,0 +1,35 @@ +# The change events related to organisation +# contains some data errors: +# - There is a change event result without any corresponding change event. This +# causes an error when visiting the change events page for this organisation. +# - There are two identical change event results for the same change event. This +# causes the change event to be shown twice in the table. (Only on PROD) +# +# Note: may require restarting the cache before the changes are noticeable. + +PREFIX code: + +# Remove the dangling change event result +DELETE { + GRAPH { + ?p ?o . + } +} +WHERE { + GRAPH { + ?p ?o . + } +} + +# Remove one of the duplicate change event results for the change event +DELETE { + GRAPH { + code:veranderingsgebeurtenisResultaat . + ?p ?o . + } +} WHERE { + GRAPH { + code:veranderingsgebeurtenisResultaat . + ?p ?o . + } +}