peixue-dev/Archive/[一次性]添加growth_record表管理师补充字段-2026-01-30.sql

32 lines
1.2 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.

-- 为 growth_record 表添加管理师补充反馈相关字段
-- 这些字段用于管理师在陪伴员反馈基础上进行补充
-- 1. 添加 manager_supplement 字段(管理师补充内容)
ALTER TABLE growth_record
ADD COLUMN manager_supplement TEXT COMMENT '管理师补充反馈' AFTER supplement;
-- 2. 添加 supplement_type 字段(补充类型)
ALTER TABLE growth_record
ADD COLUMN supplement_type INT COMMENT '补充类型1=专业建议, 2=学习指导, 3=心理辅导, 4=其他补充' AFTER manager_supplement;
-- 3. 添加 supplement_priority 字段(重要程度)
ALTER TABLE growth_record
ADD COLUMN supplement_priority INT COMMENT '重要程度1=一般, 2=重要, 3=紧急' AFTER supplement_type;
-- 4. 添加 supplement_time 字段(补充时间)
ALTER TABLE growth_record
ADD COLUMN supplement_time DATETIME COMMENT '补充时间' AFTER supplement_priority;
-- 验证字段是否添加成功
SELECT
COLUMN_NAME,
DATA_TYPE,
COLUMN_TYPE,
IS_NULLABLE,
COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'peidu'
AND TABLE_NAME = 'growth_record'
AND COLUMN_NAME IN ('manager_supplement', 'supplement_type', 'supplement_priority', 'supplement_time')
ORDER BY ORDINAL_POSITION;