diff --git a/whelktool/scripts/cleanups/2024/11/remove_deleted_Svl_elib_holds.groovy b/whelktool/scripts/cleanups/2024/11/remove_deleted_Svl_elib_holds.groovy new file mode 100755 index 0000000000..411820026b --- /dev/null +++ b/whelktool/scripts/cleanups/2024/11/remove_deleted_Svl_elib_holds.groovy @@ -0,0 +1,18 @@ +//241125 KP, removes all fake deleted holds for Svl with 'origin:Elib' + +String Svl_elib_holds = """ + collection = 'hold' + and data#>>'{@graph,1,heldBy,@id}' = 'https://libris.kb.se/library/Svl' + and data#>'{@graph,1,cataloguersNote}' @> '["origin:Elib"]'::jsonb + and data#>'{@graph,1,cataloguersNote}' @> '["deleted"]'::jsonb + and deleted = false + """ + + +selectBySqlWhere(Svl_elib_holds) { d -> + //def hold = d.getGraph() + //def id = hold[0].'@id' + //println('I: ' + id) + //println(hold) + d.scheduleDelete(loud: true) +}