X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=remove_ou_data%2F02_remove_patron_extras.sql;fp=remove_ou_data%2F02_remove_patron_extras.sql;h=a9f684d1aa027d20e5702a5a49fbc776c4e86732;hp=fc715d6f5cfc1fc23ca6fc0dcaa5e6cf8a25e61e;hb=0c0fb7ed46be05a8e344c141238b63433594fa21;hpb=dd1b9d88e1c0097a696b628dfd36cc4b57f0dc79 diff --git a/remove_ou_data/02_remove_patron_extras.sql b/remove_ou_data/02_remove_patron_extras.sql index fc715d6..a9f684d 100644 --- a/remove_ou_data/02_remove_patron_extras.sql +++ b/remove_ou_data/02_remove_patron_extras.sql @@ -55,10 +55,10 @@ DELETE FROM actor.card WHERE usr IN UPDATE actor.usr SET card = NULL WHERE home_ou IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); -DELETE FROM actor.usr_address 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)); UPDATE actor.usr SET mailing_address = NULL, billing_address = NULL WHERE home_ou IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del); +DELETE FROM actor.usr_address 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 actor.usr_message 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));