SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

--
-- Table structure for table `ne_info`
--
CREATE TABLE IF NOT EXISTS `ne_info` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型',
  `ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元ID',
  `rm_uid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元资源唯一标识',
  `ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元名称',
  `ne_version` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '2' COMMENT '网元版本',
  `schema` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'http' COMMENT '网元模式 http/https',
  `ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元服务IP',
  `port` int DEFAULT '0' COMMENT '端口',
  `pv_flag` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'PNF' COMMENT '网元虚拟化标识 物理PNF 虚拟VNF',
  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'AreaNet' COMMENT '省份地域',
  `vendor_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '厂商名称',
  `dn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '-' COMMENT '网络标识',
  `ne_address` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'MAC地址',
  `host_ids` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '网元主机ID组 数据格式(ssh,telnet) UDM(ssh,telnet,redis) UPF(ssh,telnet,telnet)',
  `status` int DEFAULT '0' COMMENT '网元状态 0离线 1在线 2配置待下发 3备用模式',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注',
  `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
  `create_time` bigint DEFAULT '0' COMMENT '创建时间',
  `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者',
  `update_time` bigint DEFAULT '0' COMMENT '更新时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `ux_netype_neid` (`ne_type`,`ne_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网元_基础信息表 关联对应版本、授权、主机';

-- ----------------------------
-- COLUMN for ne_info
-- ----------------------------
ALTER TABLE `ne_info` MODIFY COLUMN `id` bigint(20) NOT NULL FIRST;
ALTER TABLE `ne_info` MODIFY COLUMN `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元类型' AFTER `id`;
ALTER TABLE `ne_info` MODIFY COLUMN `ne_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网元ID' AFTER `ne_type`;
ALTER TABLE `ne_info` MODIFY COLUMN `rm_uid` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '网元资源唯一标识' AFTER `ne_id`;
ALTER TABLE `ne_info` MODIFY COLUMN `ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '网元名称' AFTER `rm_uid`;
ALTER TABLE `ne_info` MODIFY COLUMN `ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '网元服务IP' AFTER `ne_name`;
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 'AreaNet' COMMENT '省份地域' AFTER `pv_flag`;
ALTER TABLE `ne_info` MODIFY COLUMN `vendor_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '-' COMMENT '厂商名称' AFTER `province`;
ALTER TABLE `ne_info` MODIFY COLUMN `dn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '-' COMMENT '网络标识' AFTER `vendor_name`;
ALTER TABLE `ne_info` MODIFY COLUMN `host_ids` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '网元主机ID组 数据格式(ssh,telnet) UDM(ssh,telnet,redis) UPF(ssh,telnet,telnet)' AFTER `ne_address`;
ALTER TABLE `ne_info` MODIFY COLUMN `status` int(11) NULL DEFAULT 0 COMMENT '网元状态 0离线 1在线 2配置待下发 3备用模式' AFTER `host_ids`;
ALTER TABLE `ne_info` ADD COLUMN `ne_version` varchar(32) NULL DEFAULT '2' COMMENT '网元版本' AFTER `ne_name`;
ALTER TABLE `ne_info` ADD COLUMN `schema` varchar(12) NULL DEFAULT 'http' COMMENT '网元模式 http/https' AFTER `ne_version`;
ALTER TABLE `ne_info` COMMENT = '网元_基础信息表 关联对应版本、授权、主机';
ALTER TABLE `ne_info` MODIFY COLUMN `id` bigint(20) NOT NULL AUTO_INCREMENT;

-- ----------------------------
-- Data for ne_info
-- ----------------------------
UPDATE `ne_info` SET `ne_version` = '2', `schema` = 'http' WHERE `ne_version` IS NULL OR `schema` IS NULL;

SET FOREIGN_KEY_CHECKS=1;

-- Dump completed on 2025-02-14 15:26:56
