From 39c739cec27e2fc042d2f0ab72930a41604a3d45 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Mon, 27 Feb 2017 08:34:45 -0500 Subject: [PATCH 1/1] add removing usr circ history to remove_ou scripts --- remove_ou_data/12_remove_more_patron_extras.sql | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/remove_ou_data/12_remove_more_patron_extras.sql b/remove_ou_data/12_remove_more_patron_extras.sql index a9a2dc2..b3a64de 100644 --- a/remove_ou_data/12_remove_more_patron_extras.sql +++ b/remove_ou_data/12_remove_more_patron_extras.sql @@ -25,5 +25,7 @@ DELETE FROM action.non_cataloged_circulation WHERE patron IN (SELECT id FROM actor.usr WHERE home_ou IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del)); DELETE FROM action.non_cataloged_circulation WHERE staff IN (SELECT id FROM actor.usr WHERE home_ou IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del)); +DELETE FROM action.usr_circ_history WHERE usr IN +(SELECT id FROM actor.usr WHERE home_ou IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del)); COMMIT; -- 1.7.2.5