Merge remote-tracking branch 'origin/main' into lichang

This commit is contained in:
TsMask
2024-05-30 19:56:07 +08:00
23 changed files with 1804 additions and 1710 deletions

View File

@@ -57,6 +57,81 @@ CREATE TABLE IF NOT EXISTS `alarm_event` (
UNIQUE INDEX `idx_uni_aid_ne_aseq`(`ne_type`, `ne_id`, `alarm_id`, `alarm_seq`) USING BTREE,
INDEX `idx_event_time`(`event_time`) USING BTREE,
INDEX `idx_severity_status`(`alarm_status`, `orig_severity`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 228788 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- Move event alarm from table alarm to alarm_event
START TRANSACTION;
INSERT INTO
`omc_db`.`alarm_event` (
`alarm_seq`,
`alarm_id`,
`alarm_title`,
`ne_type`,
`ne_id`,
`alarm_code`,
`event_time`,
`alarm_type`,
`orig_severity`,
`perceived_severity`,
`pv_flag`,
`ne_name`,
`object_uid`,
`object_name`,
`object_type`,
`location_info`,
`province`,
`alarm_status`,
`specific_problem`,
`specific_problem_id`,
`add_info`,
`counter`,
`latest_event_time`,
`ack_state`,
`ack_time`,
`ack_user`,
`clear_type`,
`clear_time`,
`clear_user`,
`timestamp`
)
SELECT
`alarm_seq`,
`alarm_id`,
`alarm_title`,
`ne_type`,
`ne_id`,
`alarm_code`,
`event_time`,
`alarm_type`,
`orig_severity`,
`perceived_severity`,
`pv_flag`,
`ne_name`,
`object_uid`,
`object_name`,
`object_type`,
`location_info`,
`province`,
`alarm_status`,
`specific_problem`,
`specific_problem_id`,
`add_info`,
`counter`,
`latest_event_time`,
`ack_state`,
`ack_time`,
`ack_user`,
`clear_type`,
`clear_time`,
`clear_user`,
`timestamp`
FROM `omc_db`.`alarm`
WHERE
`orig_severity` = 'Event';
DELETE FROM `omc_db`.`alarm` WHERE `orig_severity` = 'Event';
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;