Files
hzdyjs/docs/设计文档/database/假期留宿_student_phone允许为空.sql
T
2026-10-20 11:50:53 +08:00

24 lines
1.2 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.
-- ============================================================
-- 假期留宿:student_phone 允许为空
-- 背景:学生档案无手机号时,申请 INSERT 省略 student_phone,
-- 原 NOT NULL 无默认值会报 Field 'student_phone' doesn't have a default value
-- 目的:仅改库即可恢复申请,无需立即发版
-- 日期:2026-10-15
-- ============================================================
-- 主表:允许联系电话为空
ALTER TABLE `xg_holiday_stay`
MODIFY COLUMN `student_phone` varchar(20) DEFAULT NULL COMMENT '学生联系电话';
-- 如存在历史表,一并放宽(没有可跳过)
-- ALTER TABLE `xg_holiday_stay_his`
-- MODIFY COLUMN `student_phone` varchar(20) DEFAULT NULL COMMENT '学生联系电话';
-- ------------------------------------------------------------
-- 可选预防:紧急联系人/电话同样是 NOT NULL,表单空串一般能写入;
-- 若希望彻底避免同类 SQL 报错,可一并执行:
-- ALTER TABLE `xg_holiday_stay`
-- MODIFY COLUMN `emergency_contact` varchar(50) DEFAULT NULL COMMENT '紧急联系人姓名',
-- MODIFY COLUMN `emergency_phone` varchar(20) DEFAULT NULL COMMENT '紧急联系人电话';
-- ------------------------------------------------------------