fix: event alarm not insert to table alarm_event as manual sync alarm

This commit is contained in:
2024-07-18 20:10:23 +08:00
parent db5107e06f
commit 01487e3ba6
2 changed files with 21 additions and 3 deletions

View File

@@ -133,4 +133,9 @@ DELETE FROM `alarm` WHERE `orig_severity` = 'Event';
COMMIT;
DELETE FROM alarm_event WHERE id NOT IN (SELECT MIN(id) FROM alarm_event GROUP BY `ne_type`, `ne_id`, `alarm_id`, `event_time`);
ALTER TABLE `alarm_event`
ADD UNIQUE INDEX IF NOT EXISTS `idx_uni_aid_ne_time`(`ne_type`, `ne_id`, `alarm_id`, `event_time`) USING BTREE;
SET FOREIGN_KEY_CHECKS = 1;