X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=remove_ou_data%2F15_remove_ou_extras.sql;fp=remove_ou_data%2F15_remove_ou_extras.sql;h=2cd9e29e516b076532aae791f51e1cae0caab8bf;hp=08bab8010e564e8a2480fc44ec11c2d8ef30e85d;hb=9371180a7f4ff887eb3b78076745c200b212ad0a;hpb=571263faefabdc094e96ab6bcbb727129791985f diff --git a/remove_ou_data/15_remove_ou_extras.sql b/remove_ou_data/15_remove_ou_extras.sql index 08bab80..2cd9e29 100644 --- a/remove_ou_data/15_remove_ou_extras.sql +++ b/remove_ou_data/15_remove_ou_extras.sql @@ -38,6 +38,13 @@ WHERE copy_location IN (SELECT id FROM asset.copy_location WHERE owning_lib IN DELETE FROM asset.copy_location WHERE owning_lib IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); +DELETE FROM money.account_adjustment WHERE billing IN + (SELECT id FROM money.billing WHERE btype IN ( + SELECT id FROM config.billing_type + WHERE owner IN + (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del) +)); + DELETE FROM money.billing WHERE btype IN ( SELECT id FROM config.billing_type