Delete invalid alert maps (#8390)

This commit is contained in:
Tony Murray
2018-03-15 09:44:47 -05:00
committed by Neil Lathwood
parent 0aed9788e3
commit aec567f890

5
sql-schema/245.sql Normal file
View File

@@ -0,0 +1,5 @@
DELETE FROM `alert_device_map` WHERE `device_id` NOT IN (SELECT `device_id` FROM `devices`);
DELETE FROM `alert_device_map` WHERE `rule_id` NOT IN (SELECT `id` FROM `alert_rules`);
DELETE FROM `alert_group_map` WHERE `group_id` NOT IN (SELECT `group_id` FROM `device_groups`);
DELETE FROM `alert_group_map` WHERE `rule_id` NOT IN (SELECT `id` FROM `alert_rules`);