-- ----------------------------
-- Table structure for alarm
-- ----------------------------
DROP TABLE IF EXISTS `alarm`;
CREATE TABLE `alarm` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ne_id` bigint DEFAULT '0' COMMENT '网元ID',
  `created_time` bigint DEFAULT '0' COMMENT '创建时间',
  `alarm_seq` int DEFAULT '0' COMMENT '告警序号 同网元类型连续递增',
  `alarm_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '告警ID',
  `alarm_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警标题',
  `alarm_code` int DEFAULT '0' COMMENT '告警状态码',
  `event_time` bigint DEFAULT '0' COMMENT '产生时间',
  `alarm_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警类型',
  `orig_severity` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Minor' COMMENT '严重程度',
  `perceived_severity` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Minor' COMMENT '告警级别',
  `object_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '对象ID',
  `object_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '对象名称',
  `object_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '对象类型',
  `location_info` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警定位信息',
  `alarm_status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Active' COMMENT '告警状态',
  `specific_problem` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警问题原因',
  `specific_problem_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警问题原因ID',
  `add_info` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '告警辅助信息',
  `ack_state` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'NotAck' COMMENT '确认状态',
  `ack_time` bigint DEFAULT '0' COMMENT '确认时间',
  `ack_user` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '确认用户',
  `clear_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'NotClear' COMMENT '清除状态',
  `clear_time` bigint DEFAULT '0' COMMENT '清除时间',
  `clear_user` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '清除用户',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uk_alarm_aid_aseq_atype` (`ne_id`, `alarm_id`, `alarm_seq`, `alarm_type`) USING BTREE COMMENT '唯一网元资源产生的ID与序号与状态',
  KEY `idx_alarm_status_severity_time` (`alarm_status`,`orig_severity`,`event_time`) USING BTREE COMMENT '索引-告警状态_告警级别_事件时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='告警_记录表';
