From e236bd7ca235549f1f6141cac316d204ffaf74cc Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Wed, 31 Jan 2018 08:47:22 -0500 Subject: [PATCH 1/1] add removal of copy tag stuff from remove ou scripts --- remove_ou_data/01_easy_deletes.sql | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/remove_ou_data/01_easy_deletes.sql b/remove_ou_data/01_easy_deletes.sql index e6d58ec..2af8833 100644 --- a/remove_ou_data/01_easy_deletes.sql +++ b/remove_ou_data/01_easy_deletes.sql @@ -80,5 +80,7 @@ DELETE FROM vandelay.import_bib_trash_group WHERE owner IN (SELECT (actor.org_un DELETE FROM vandelay.import_item_attr_definition WHERE owner IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); DELETE FROM vandelay.match_set WHERE owner IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); DELETE FROM vandelay.merge_profile WHERE owner IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); - +DELETE FROM asset.copy_tag_copy_map 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)); +DELETE FROM asset.copy_tag WHERE owner IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); +DELETE FROM config.copy_tag_type WHERE owner IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); COMMIT; -- 1.7.2.5