X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=remove_ou_data%2F03_remove_holds.sql;h=80afcf7da65f2848815b8f7b55257ff78826a7af;hp=433f3efdd69997a6c03f567d624d4cc4e8b45302;hb=e327c4743fe61686222f0e3928a48ece319a1e3b;hpb=96c4a5bf729832f704dd86f2271d6f3531ebb4e9 diff --git a/remove_ou_data/03_remove_holds.sql b/remove_ou_data/03_remove_holds.sql index 433f3ef..80afcf7 100644 --- a/remove_ou_data/03_remove_holds.sql +++ b/remove_ou_data/03_remove_holds.sql @@ -30,6 +30,8 @@ DELETE FROM action.hold_request WHERE current_shelf_lib IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); DELETE FROM action.hold_request WHERE pickup_lib IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); +DELETE FROM action.hold_request WHERE request_lib IN +(SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); DELETE FROM action.aged_hold_request WHERE pickup_lib IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); @@ -41,7 +43,7 @@ DELETE FROM action.aged_hold_request WHERE request_lib IN DELETE FROM action.hold_request WHERE requestor 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.hold_request WHERE fulfillment_lib IN +DELETE FROM action.hold_request WHERE fulfillment_time IS NOT NULL AND fulfillment_lib IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); COMMIT;