commenting out the default graphic in mig-reporter
[migration-tools.git] / remove_ou_data / 03_remove_holds.sql
index 76dfa14..80afcf7 100644 (file)
@@ -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,6 +43,9 @@ 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_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;
 
 ALTER TABLE action.hold_request ENABLE TRIGGER action_hold_request_aging_tgr;