/*
 Navicat Premium Data Transfer

 Source Server         : local_mariadb
 Source Server Type    : MariaDB
 Source Server Version : 100338 (10.3.38-MariaDB)
 Source Host           : localhost:33066
 Source Schema         : omc_db

 Target Server Type    : MariaDB
 Target Server Version : 100338 (10.3.38-MariaDB)
 File Encoding         : 65001

 Date: 24/05/2024 15:44:03
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for alarm_event
-- ----------------------------
DROP TABLE IF EXISTS `alarm_event`;
CREATE TABLE `alarm_event` (
  `id` int NOT NULL AUTO_INCREMENT,
  `alarm_seq` int DEFAULT NULL,
  `alarm_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `alarm_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `ne_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `alarm_code` int DEFAULT NULL,
  `event_time` datetime DEFAULT NULL,
  `alarm_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
  `orig_severity` enum('Critical','Major','Minor','Warning','Event') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'Minor' COMMENT '1: Critical, 2: Major, 3: Minor, 4: Warning, 5: Event(Only VNF)',
  `perceived_severity` enum('Critical','Major','Minor','Warning','Event') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '1: Critical, 2: Major, 3: Minor, 4: Warning, 5: Event(Only VNF)',
  `pv_flag` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `ne_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `object_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `object_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0',
  `object_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `location_info` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `alarm_status` int NOT NULL DEFAULT '1' COMMENT '0:clear, 1:active',
  `specific_problem` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `specific_problem_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `add_info` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `counter` int DEFAULT '0',
  `latest_event_time` datetime DEFAULT NULL,
  `ack_state` tinyint DEFAULT '0' COMMENT '0: Unacked, 1: Acked',
  `ack_time` datetime DEFAULT NULL,
  `ack_user` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `clear_type` tinyint DEFAULT '0' COMMENT '0: Unclear, 1: AutoClear, 2: ManualClear',
  `clear_time` datetime DEFAULT NULL,
  `clear_user` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `timestamp` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `idx_pk_id` (`id`) USING BTREE,
  UNIQUE KEY `idx_uni_aid_ne_aseq` (`ne_type`,`ne_id`,`alarm_id`,`alarm_seq`) USING BTREE,
  KEY `idx_event_time` (`event_time`) USING BTREE,
  KEY `idx_severity_status` (`alarm_status`,`orig_severity`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

SET FOREIGN_KEY_CHECKS = 1;
