X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=remove_ou_data%2F02_remove_patron_extras.sql;h=fc715d6f5cfc1fc23ca6fc0dcaa5e6cf8a25e61e;hp=ffbd78933b44cf929943547d48811f6c63ef5357;hb=b4a45202fa9b19f2e38c22bafa36388d1e004dfe;hpb=a42d5301d03e7f7c424df4642a31125c09aeafa2 diff --git a/remove_ou_data/02_remove_patron_extras.sql b/remove_ou_data/02_remove_patron_extras.sql index ffbd789..fc715d6 100644 --- a/remove_ou_data/02_remove_patron_extras.sql +++ b/remove_ou_data/02_remove_patron_extras.sql @@ -84,6 +84,12 @@ DELETE FROM action.survey_question WHERE survey IN DELETE FROM action.survey WHERE owner IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); +DELETE FROM permission.usr_perm_map 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)); + +DELETE FROM permission.usr_grp_map 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)); + COMMIT; DROP INDEX actor.tmp_addr_replaces;