X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=remove_ou_data%2F04_remove_circ.sql;h=4780c9d783bab096718d00398ad0274ff502e601;hp=30730853e37fbdfb6a3775cb4ac5209ad95cfff9;hb=06e695c596e784a9e2634b25612b4bd23ac047af;hpb=099b914088e5adbba5b47f4f18514ce419b1af6a diff --git a/remove_ou_data/04_remove_circ.sql b/remove_ou_data/04_remove_circ.sql index 3073085..4780c9d 100644 --- a/remove_ou_data/04_remove_circ.sql +++ b/remove_ou_data/04_remove_circ.sql @@ -24,10 +24,6 @@ ALTER TABLE action.circulation DISABLE TRIGGER age_parent_circ; BEGIN; -UPDATE action.circulation SET parent_circ = NULL WHERE parent_circ -(SELECT id FROM action.circulation WHERE circ_lib = (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del)) -AND circ_lib NOT IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); - DELETE FROM action.circulation 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));