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 . + } +}