--
-- Table structure for table `ue_event_mme`
--
CREATE TABLE IF NOT EXISTS `ue_event_mme` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
  `ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '',
  `rm_uid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '可能没有',
  `timestamp` bigint DEFAULT '0' COMMENT '接收到时间',
  `event_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '事件类型',
  `event_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'data JSON String',
  `created_at` bigint DEFAULT '0' COMMENT '记录创建存储毫秒',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `idx_mme_type_t` (`event_type`,`timestamp`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='UE事件_MME终端接入';

-- ----------------------------
-- COLUMN for ue_event_mme
-- ----------------------------
ALTER TABLE `ue_event_mme` DROP INDEX `id`;
ALTER TABLE `ue_event_mme` DROP INDEX `idx_type_timestamp`;
ALTER TABLE `ue_event_mme` MODIFY COLUMN `ne_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' AFTER `id`;
ALTER TABLE `ue_event_mme` MODIFY COLUMN `ne_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' AFTER `ne_type`;
ALTER TABLE `ue_event_mme` MODIFY COLUMN `rm_uid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '可能没有' AFTER `ne_name`;
ALTER TABLE `ue_event_mme` MODIFY COLUMN `timestamp` bigint(20) NULL DEFAULT 0 COMMENT '接收到时间' AFTER `rm_uid`;
ALTER TABLE `ue_event_mme` MODIFY COLUMN `event_type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '事件类型' AFTER `timestamp`;
ALTER TABLE `ue_event_mme` MODIFY COLUMN `event_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'data JSON String' AFTER `event_type`;
ALTER TABLE `ue_event_mme` MODIFY COLUMN `created_at` bigint(20) NULL DEFAULT 0 COMMENT '记录创建存储毫秒' AFTER `event_json`;
ALTER TABLE `ue_event_mme` ADD INDEX `idx_mme_type_t`(`event_type`, `timestamp`) USING BTREE;
ALTER TABLE `ue_event_mme` COMMENT = 'UE事件_MME终端接入';
-- 更新数据
UPDATE `ue_event_mme` SET `event_type` = 'Auth' WHERE `event_type` = 'auth-result';
UPDATE `ue_event_mme` SET `event_type` = 'Detach' WHERE `event_type` = 'detach';
UPDATE `ue_event_mme` SET `event_type` = 'CM' WHERE `event_type` = 'cm-state';

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