From 0a095537e79a9a4d72601e6bda4c23063d425dbb Mon Sep 17 00:00:00 2001 From: kwahlin Date: Mon, 11 Sep 2023 16:13:01 +0200 Subject: [PATCH 1/2] Add cleanup script --- .../09/lxl-4263-missing-description-modifier.groovy | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 whelktool/scripts/cleanups/2023/09/lxl-4263-missing-description-modifier.groovy diff --git a/whelktool/scripts/cleanups/2023/09/lxl-4263-missing-description-modifier.groovy b/whelktool/scripts/cleanups/2023/09/lxl-4263-missing-description-modifier.groovy new file mode 100644 index 0000000000..f97bad9821 --- /dev/null +++ b/whelktool/scripts/cleanups/2023/09/lxl-4263-missing-description-modifier.groovy @@ -0,0 +1,12 @@ +def where = """ + changedIn = 'batch import' + and modified::date = '2023-09-08' + and data#>'{@graph,0,descriptionLastModifier,@id}' = 'null' +""" + +selectBySqlWhere(where) { + def record = it.graph[0] + record['descriptionCreator'] = ['@id':'https://libris.kb.se/library/SEK'] + record['descriptionLastModifier'] = ['@id':'https://libris.kb.se/library/SEK'] + it.scheduleSave() +} From 92263465ea63daeaf1fa93aac086b0bfb9eac727 Mon Sep 17 00:00:00 2001 From: kwahlin <72360110+kwahlin@users.noreply.github.com> Date: Mon, 11 Sep 2023 16:44:42 +0200 Subject: [PATCH 2/2] Update date comparison in where clause Co-authored-by: Anders Jensen-Urstad --- .../2023/09/lxl-4263-missing-description-modifier.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whelktool/scripts/cleanups/2023/09/lxl-4263-missing-description-modifier.groovy b/whelktool/scripts/cleanups/2023/09/lxl-4263-missing-description-modifier.groovy index f97bad9821..5aac5d37f3 100644 --- a/whelktool/scripts/cleanups/2023/09/lxl-4263-missing-description-modifier.groovy +++ b/whelktool/scripts/cleanups/2023/09/lxl-4263-missing-description-modifier.groovy @@ -1,6 +1,6 @@ def where = """ changedIn = 'batch import' - and modified::date = '2023-09-08' + and modified > '2023-09-07' and modified < '2023-09-09' and data#>'{@graph,0,descriptionLastModifier,@id}' = 'null' """