From 5eccd3f13f18cf1049cd1ea24a2df36061306158 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Wed, 22 Jul 2020 14:20:36 -0400 Subject: [PATCH] removing copy alerts --- remove_ou_data/06_remove_copies.sql | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/remove_ou_data/06_remove_copies.sql b/remove_ou_data/06_remove_copies.sql index b3f0aed..58cbcb0 100644 --- a/remove_ou_data/06_remove_copies.sql +++ b/remove_ou_data/06_remove_copies.sql @@ -25,6 +25,12 @@ CREATE INDEX tmp_import_as ON vandelay.import_item(imported_as); BEGIN; +DELETE FROM asset.copy_alert WHERE copy IN ( + SELECT id FROM asset.copy WHERE circ_lib IN + (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del) +); + + -- NOTE: no FK DELETE FROM asset.opac_visible_copies WHERE copy_id IN ( SELECT id FROM asset.copy WHERE circ_lib IN -- 1.7.2.5