SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for ne_info
-- ----------------------------
CREATE TABLE IF NOT EXISTS `ne_info`  (
  `id` int NOT NULL AUTO_INCREMENT,
  `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `rm_uid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  `port` int NULL DEFAULT NULL,
  `pv_flag` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'PNF' COMMENT '\'PNF\',\'VNF\'',
  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省份地域',
  `vendor_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `dn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
  `ne_address` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'MAC地址',
  `status` int NULL DEFAULT 0 COMMENT '0离线 1在线 2配置待下发',
  `update_time` bigint NULL DEFAULT 0 COMMENT '更新时间',
  `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
  `host_ids` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '网元主机ID组 数据格式(ssh,telnet,telnet)',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `idx_netype_neid`(`ne_type` ASC, `ne_id` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网元信息表 对应一个网元版本、网元授权、网元主机' ROW_FORMAT = DYNAMIC;

-- 20240511前旧表更新
ALTER TABLE `ne_info` COMMENT = '网元信息表 对应一个网元版本、网元授权、网元主机';
ALTER TABLE `ne_info` ADD COLUMN IF NOT EXISTS `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者' AFTER `update_time`;
ALTER TABLE `ne_info` MODIFY COLUMN `pv_flag` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'PNF' COMMENT '\'PNF\',\'VNF\'' AFTER `port`;
ALTER TABLE `ne_info` MODIFY COLUMN `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省份地域' AFTER `pv_flag`;
ALTER TABLE `ne_info` MODIFY COLUMN `ne_address` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'MAC地址' AFTER `dn`;
ALTER TABLE `ne_info` MODIFY COLUMN `status` int NULL DEFAULT 0 COMMENT '0离线 1在线 2配置待下发' AFTER `ne_address`;
ALTER TABLE `ne_info` MODIFY COLUMN `update_time` bigint NULL DEFAULT 0 COMMENT '更新时间' AFTER `status`;

SET FOREIGN_KEY_CHECKS=1;
