yumi-golang/migrations/040_agora_error_log.sql
2026-05-15 19:42:02 +08:00

29 lines
1.9 KiB
SQL

CREATE TABLE IF NOT EXISTS `agora_error_log` (
`id` BIGINT NOT NULL COMMENT '主键ID',
`sys_origin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '系统来源',
`user_id` BIGINT NOT NULL DEFAULT 0 COMMENT '上报用户ID',
`room_id` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '房间ID',
`agora_uid` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'Agora UID',
`error_code_type` VARCHAR(128) NOT NULL DEFAULT '' COMMENT 'Agora ErrorCodeType',
`connection_changed_reason_type` VARCHAR(128) NOT NULL DEFAULT '' COMMENT 'Agora ConnectionChangedReasonType',
`banned_by_server` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否 BannedByServer/kicking-rule',
`is_timeout` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否超时',
`token_request_success` TINYINT(1) DEFAULT NULL COMMENT 'token 请求是否成功',
`network_type` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '网络类型',
`req_client` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '请求客户端',
`req_app_intel` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'App版本信息请求头',
`client_ip` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '客户端IP',
`user_agent` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'User-Agent',
`raw_payload` MEDIUMTEXT COMMENT '原始上报内容',
`create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_agora_error_sys_time` (`sys_origin`, `create_time`),
KEY `idx_agora_error_user_time` (`user_id`, `create_time`),
KEY `idx_agora_error_room_time` (`room_id`, `create_time`),
KEY `idx_agora_error_code_time` (`error_code_type`, `create_time`),
KEY `idx_agora_error_reason` (`connection_changed_reason_type`),
KEY `idx_agora_error_banned_time` (`banned_by_server`, `create_time`),
KEY `idx_agora_error_network` (`network_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Agora错误日志';