X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=remove_ou_data%2F15_clear_auditors.sql;h=685d1cb23377db53d3fe70b9fcd37d1befb22c6d;hp=ab941c30fc57a26ec9c7053851d6e43a272951ac;hb=cbf98af9e9d79cee9f8c99267c3e39326487167e;hpb=c919228a7234c1fdfa9f9cfbae245fc30731eb85 diff --git a/remove_ou_data/15_clear_auditors.sql b/remove_ou_data/15_clear_auditors.sql index ab941c3..685d1cb 100644 --- a/remove_ou_data/15_clear_auditors.sql +++ b/remove_ou_data/15_clear_auditors.sql @@ -37,5 +37,9 @@ DELETE FROM auditor.asset_call_number_history WHERE owning_lib IN ( FROM actor.org_unit WHERE shortname = :ou_to_del ); - +DELETE FROM auditor.actor_usr_address_history WHERE usr IN ( + SELECT id + FROM actor.usr + WHERE home_ou = (SELECT id FROM actor.org_unit WHERE shortname = :ou_to_del) +); COMMIT;