xinli/Archive/添加AI分析字段.sql
2026-01-30 16:23:31 +08:00

21 lines
1.1 KiB
SQL
Raw Permalink 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分析字段如果不存在
ALTER TABLE psy_assessment_report
ADD COLUMN IF NOT EXISTS ai_analysis LONGTEXT COMMENT 'AI分析结果HTML格式',
ADD COLUMN IF NOT EXISTS ai_analysis_time DATETIME COMMENT 'AI分析生成时间';
-- 为问卷报告表添加AI分析字段如果不存在
ALTER TABLE psy_questionnaire_report
ADD COLUMN IF NOT EXISTS ai_analysis LONGTEXT COMMENT 'AI分析结果HTML格式',
ADD COLUMN IF NOT EXISTS ai_analysis_time DATETIME COMMENT 'AI分析生成时间';
-- 如果上面的语法不支持使用以下方式MySQL 5.7及以下)
-- 先检查字段是否存在,不存在则添加
-- 测评报告表
-- ALTER TABLE psy_assessment_report ADD COLUMN ai_analysis LONGTEXT COMMENT 'AI分析结果HTML格式';
-- ALTER TABLE psy_assessment_report ADD COLUMN ai_analysis_time DATETIME COMMENT 'AI分析生成时间';
-- 问卷报告表
-- ALTER TABLE psy_questionnaire_report ADD COLUMN ai_analysis LONGTEXT COMMENT 'AI分析结果HTML格式';
-- ALTER TABLE psy_questionnaire_report ADD COLUMN ai_analysis_time DATETIME COMMENT 'AI分析生成时间';