X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=sql%2Fnuke-patrons-and-circs.sql;fp=sql%2Fnuke-patrons-and-circs.sql;h=4b7c47f8cfcc401379f85fb83dc82094fa12d402;hp=0000000000000000000000000000000000000000;hb=66a5ec18848e64e83bdf7e1bd3ff84bc696a1845;hpb=70337e01f659d9c30a21b6576895d4a309fd4aca diff --git a/sql/nuke-patrons-and-circs.sql b/sql/nuke-patrons-and-circs.sql new file mode 100644 index 0000000..4b7c47f --- /dev/null +++ b/sql/nuke-patrons-and-circs.sql @@ -0,0 +1,20 @@ +alter table actor.usr disable rule protect_user_delete; +begin; +delete from actor.usr where usrname !~ 'admin'; +delete from actor.usr_note where usr not in (select id from actor.usr); +delete from actor.usr_address where usr not in (select id from actor.usr); +delete from actor.card where usr not in (select id from actor.usr); +delete from action.circulation; +delete from action.hold_request; +delete from money.billing; +delete from money.grocery; +delete from action.non_cataloged_circulation; +delete from action.in_house_use; +delete from reporter.template_folder where owner not in (select id from actor.usr); +delete from reporter.report_folder where owner not in (select id from actor.usr); +delete from reporter.output_folder where owner not in (select id from actor.usr); +delete from reporter.template where owner not in (select id from actor.usr); +delete from reporter.report where owner not in (select id from actor.usr); +delete from reporter.schedule where runner not in (select id from actor.usr); +commit; +alter table actor.usr enable rule protect_user_delete;