clean up reporter share withs in remove ou scripts
authorRogan Hamby <rhamby@esilibrary.com>
Fri, 9 Feb 2018 15:09:03 +0000 (10:09 -0500)
committerRogan Hamby <rhamby@esilibrary.com>
Fri, 9 Feb 2018 15:09:03 +0000 (10:09 -0500)
remove_ou_data/10_clear_vandelay_reports.sql

index b68bef9..2a44d2e 100644 (file)
@@ -55,4 +55,10 @@ DELETE FROM reporter.template WHERE owner IN
 DELETE FROM reporter.template_folder WHERE owner 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 reporter.report_folder SET share_with = NULL WHERE share_with IN 
+(SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del);
+
+UPDATE reporter.template_folder SET share_with = NULL WHERE share_with IN 
+(SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del);
+
 COMMIT;