--
-- Table structure for table `u_auth_user`
--
-- DROP TABLE IF EXISTS `u_auth_user`;
CREATE TABLE IF NOT EXISTS `u_auth_user` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
  `imsi` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'SIM卡/USIM卡ID',
  `ne_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'UDM网元标识',
  `amf` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'AMF',
  `status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '状态',
  `ki` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'ki',
  `algo_index` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'algoIndex',
  `opc` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT 'OPC',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `imsi_ne` (`imsi`,`ne_id`) USING BTREE COMMENT 'imsi_neid唯一主键'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UDM鉴权用户';

-- Dump completed on 2024-03-06 17:26:59

ALTER TABLE `u_auth_user` MODIFY COLUMN IF EXISTS `imsi` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'SIM卡/USIM卡ID' AFTER `id`;
ALTER TABLE `u_auth_user` MODIFY COLUMN IF EXISTS `ne_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'UDM网元标识' AFTER `imsi`;
ALTER TABLE `u_auth_user` MODIFY COLUMN IF EXISTS `amf` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'AMF' AFTER `ne_id`;
ALTER TABLE `u_auth_user` MODIFY COLUMN IF EXISTS `status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '状态' AFTER `amf`;
ALTER TABLE `u_auth_user` MODIFY COLUMN IF EXISTS `ki` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'ki' AFTER `status`;
ALTER TABLE `u_auth_user` MODIFY COLUMN IF EXISTS `algo_index` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'algoIndex' AFTER `ki`;
ALTER TABLE `u_auth_user` MODIFY COLUMN IF EXISTS `opc` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'OPC' AFTER `algo_index`;
ALTER TABLE `u_auth_user` DROP COLUMN IF EXISTS `msisdn`;
ALTER TABLE `u_auth_user` RENAME INDEX IF EXISTS `imsi_ne` TO `uk_imsi_ne`;
ALTER TABLE `u_auth_user` ADD INDEX IF NOT EXISTS `idx_ne`(`ne_id`) USING BTREE COMMENT 'neid索引';
