xinli/sql/添加综合评估报告表.sql
2025-12-19 09:03:26 +08:00

22 lines
1.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 综合评估报告表
-- 用于存储用户的综合心理评估AI分析结果
-- 创建综合评估报告表
CREATE TABLE IF NOT EXISTS `psy_comprehensive_report` (
`report_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '报告ID',
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
`report_title` varchar(200) DEFAULT '综合评估报告' COMMENT '报告标题',
`report_content` longtext COMMENT '报告内容完整HTML格式',
`ai_analysis` longtext COMMENT 'AI分析结果HTML格式',
`selected_reports` text COMMENT '选中的报告ID列表JSON格式',
`user_info_summary` text COMMENT '用户信息摘要JSON格式',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`report_id`),
KEY `idx_user_id` (`user_id`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='综合评估报告表';