X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=remove_ou_data%2F07_remove_volumes.sql;h=71fc03a4c816f689f23228b47b4816d9d2f6b85b;hp=edea650fb7a9eaeb0de22a391e5e487c64325e97;hb=06e695c596e784a9e2634b25612b4bd23ac047af;hpb=533db70cdbe7589324585cbb56d5f4fb8d543984 diff --git a/remove_ou_data/07_remove_volumes.sql b/remove_ou_data/07_remove_volumes.sql index edea650..71fc03a 100644 --- a/remove_ou_data/07_remove_volumes.sql +++ b/remove_ou_data/07_remove_volumes.sql @@ -39,14 +39,11 @@ FROM asset.call_number WHERE owning_lib IN DELETE FROM asset.call_number WHERE owning_lib IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); -UPDATE asset.call_number acn SET owning_lib = ac.circ_lib -FROM asset.copy ac -WHERE ac.call_number = acn.id -AND acn.owning_lib IN -(SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del) -AND acn.id IN -(SELECT call_number FROM asset.copy WHERE circ_lib NOT IN - (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del)); +DELETE FROM asset.call_number_prefix WHERE owning_lib IN +(SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); + +DELETE FROM asset.call_number_suffix WHERE owning_lib IN +(SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); COMMIT;