From b03e91bfac2b07f401e2a297532efee18cb38449 Mon Sep 17 00:00:00 2001 From: Rogan Hamby Date: Wed, 22 Jul 2020 15:37:28 -0400 Subject: [PATCH] add event output removal --- remove_ou_data/15_remove_ou_extras.sql | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) 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); -- 1.7.2.5