fix(personal): preserve session schema requirements

This commit is contained in:
2026-07-12 01:56:08 +08:00
parent 5b3aeadb5f
commit 12a3b1cbd3
2 changed files with 5 additions and 0 deletions
@@ -69,6 +69,7 @@ CREATE TABLE IF NOT EXISTS `aihr_personal_chat_session` (
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
`owner_user_id` bigint NOT NULL COMMENT '会话所属用户ID',
`title` varchar(200) NOT NULL COMMENT '会话标题',
`status` varchar(20) NOT NULL DEFAULT 'ACTIVE' COMMENT '会话状态',
`default_scope` varchar(50) NOT NULL DEFAULT 'PERSONAL' COMMENT '默认问答范围',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
@@ -92,5 +93,6 @@ CREATE TABLE IF NOT EXISTS `aihr_personal_chat_message` (
`latency_ms` bigint NOT NULL DEFAULT 0 COMMENT '响应耗时毫秒',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_personal_message_session` (`session_id`, `create_time`),
KEY `idx_personal_message_owner` (`tenant_id`, `owner_user_id`, `session_id`, `create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='个人AI助理对话消息';