From: Rogan Hamby Date: Mon, 17 Oct 2016 14:17:49 +0000 (-0400) Subject: update the noncat circ code to note delete non cat circs when the staff member is... X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=099b914088e5adbba5b47f4f18514ce419b1af6a;hp=5daa7e37fb3828e5bc77a037afce5c94f755cd4d update the noncat circ code to note delete non cat circs when the staff member is registered at the wrong library --- diff --git a/remove_ou_data/04_remove_circ.sql b/remove_ou_data/04_remove_circ.sql index f011c1b..3073085 100644 --- a/remove_ou_data/04_remove_circ.sql +++ b/remove_ou_data/04_remove_circ.sql @@ -47,8 +47,9 @@ DELETE FROM action.aged_circulation WHERE copy_owning_lib IN DELETE FROM action.non_cat_in_house_use WHERE org_unit IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); -DELETE FROM action.non_cat_in_house_use 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)); +UPDATE action.non_cat_in_house_use SET staff = 1 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)) +AND org_unit IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); COMMIT;