X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=remove_ou_data%2F15_remove_ou_extras.sql;fp=remove_ou_data%2F15_remove_ou_extras.sql;h=4670ad8b30f138b18265de44fd685c44d802e32d;hp=2cd9e29e516b076532aae791f51e1cae0caab8bf;hb=b03e91bfac2b07f401e2a297532efee18cb38449;hpb=85ace50585d1b7144f1618a60d70937027ecec21 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);