/*
 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: 27/07/2023 20:08:55
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for alarm
-- ----------------------------
DROP TABLE IF EXISTS `alarm`;
CREATE TABLE `alarm`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `alarm_seq` int(11) NULL 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 NULL DEFAULT NULL,
  `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `ne_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `alarm_code` int(11) NULL DEFAULT NULL,
  `event_time` datetime NULL DEFAULT NULL,
  `alarm_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `orig_severity` enum('Critical','Major','Minor','Warning','Event') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL 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 NULL 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 NULL DEFAULT NULL,
  `ne_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `object_uid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `object_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0',
  `object_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `location_info` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `alarm_status` int(11) NOT NULL DEFAULT 1 COMMENT '0:clear, 1:active',
  `specific_problem` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `specific_problem_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `add_info` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `counter` int(11) NULL DEFAULT 0,
  `latest_event_time` datetime NULL DEFAULT NULL,
  `ack_state` tinyint(4) NULL DEFAULT 0 COMMENT '0: Unacked, 1: Acked',
  `ack_time` datetime NULL DEFAULT NULL,
  `ack_user` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `clear_type` tinyint(4) NULL DEFAULT 0 COMMENT '0: Unclear, 1: AutoClear, 2: ManualClear',
  `clear_time` datetime NULL DEFAULT NULL,
  `clear_user` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `timestamp` datetime NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) USING BTREE,
  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
) ENGINE = InnoDB AUTO_INCREMENT = 109734 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;
