SET FOREIGN_KEY_CHECKS=0;

ALTER TABLE `omc_db`.`ne_info` COMMENT = '网元信息表';

ALTER TABLE `omc_db`.`ne_info` ADD COLUMN IF NOT EXISTS `host_ids` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '网元主机ID组 数据格式(ssh,telnet,telnet)' AFTER `update_time`;

ALTER TABLE `omc_db`.`ne_info` MODIFY COLUMN `status` int NULL DEFAULT 0 COMMENT '0: 在线 1: 下线 2: 备用 3: 待下发配置' AFTER `ne_address`;

-- 初始网元主机绑定
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'OMC', `host_ids` = '1,2' WHERE `id` = 1;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'IMS', `host_ids` = '3,4' WHERE `id` = 2;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'AMF', `host_ids` = '5,6' WHERE `id` = 3;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'AUSF', `host_ids` = '7,8' WHERE `id` = 4;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'SMF', `host_ids` = '11,12' WHERE `id` = 6;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'PCF', `host_ids` = '13,14' WHERE `id` = 7;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'NSSF', `host_ids` = '15,16' WHERE `id` = 8;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'NRF', `host_ids` = '17,18' WHERE `id` = 9;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'UPF', `host_ids` = '19,20,21' WHERE `id` = 10;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'LMF', `host_ids` = '22,23' WHERE `id` = 11;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'NEF', `host_ids` = '24,25' WHERE `id` = 12;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'MME', `host_ids` = '26,27' WHERE `id` = 13;
UPDATE `omc_db`.`ne_info` SET `ne_type` = 'N3IWF', `host_ids` = '28,29' WHERE `id` = 14;

SET FOREIGN_KEY_CHECKS=1;
