From: Rogan Hamby Date: Wed, 22 Jul 2020 19:37:28 +0000 (-0400) Subject: add event output removal X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=commitdiff_plain;h=b03e91bfac2b07f401e2a297532efee18cb38449 add event output removal --- diff --git a/remove_ou_data/15_remove_ou_extras.sql b/remove_ou_data/15_remove_ou_extras.sql index 2cd9e29..4670ad8 100644 --- a/remove_ou_data/15_remove_ou_extras.sql +++ b/remove_ou_data/15_remove_ou_extras.sql @@ -52,6 +52,30 @@ WHERE btype IN ( (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del) ); +DELETE FROM action_trigger.event_output WHERE id IN ( +SELECT template_output FROM action_trigger.event +WHERE event_def IN ( + SELECT id FROM action_trigger.event_definition + WHERE owner IN + (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del) +)); + +DELETE FROM action_trigger.event_output WHERE id IN ( +SELECT async_output FROM action_trigger.event +WHERE event_def IN ( + SELECT id FROM action_trigger.event_definition + WHERE owner IN + (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del) +)); + +DELETE FROM action_trigger.event_output WHERE id IN ( +SELECT error_output FROM action_trigger.event +WHERE event_def IN ( + SELECT id FROM action_trigger.event_definition + WHERE owner IN + (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del) +)); + DELETE FROM action_trigger.event WHERE event_def IN ( SELECT id FROM action_trigger.event_definition @@ -70,6 +94,7 @@ WHERE event_def IN ( WHERE owner IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del) ); + DELETE FROM action_trigger.event_definition WHERE owner IN (SELECT (actor.org_unit_descendants(id)).id from actor.org_unit where shortname = :ou_to_del);