chore(sync): 同步当前工作区全部变更(学员学号可编辑并留空自动生成等)

This commit is contained in:
buliping committed 2026-11-10 13:34:14 +08:00
1 parent 01e949093a
commit f5e8d7f564
531 files changed
+72978 -2720

No files matched your search

@@ -6,7 +6,7 @@
-- 设计依据: RailwaySystem 数据库 V2 字段设计与 Kingbase DDL 规范 V1.0 及 Round 1 审查要求
-- 安全规范:
-- 1. 严禁在脚本中出现真实教师姓名、电话、身份证、邮箱等明文数据!
-- 2. 完全采用纯 DML 数据映射: t_department -> org_name, t_title -> job_title, create_user -> create_by
-- 2. 完全采用纯 DML 数据映射: t_department -> dept_name, t_title -> job_title, create_user -> create_by
-- 3. 执行后验证迁移完整性,再将 status 与 del_flag 设为 NOT NULL 并安全移除旧列
-- ==============================================================================
@@ -15,7 +15,7 @@ BEGIN;
-- 步骤 1: 数据平滑映射 (仅更新新字段为空的行,保证幂等)
UPDATE train_teacher
SET
org_name = COALESCE(org_name, t_department),
dept_name = COALESCE(dept_name, t_department),
job_title = COALESCE(job_title, t_title),
create_by = COALESCE(create_by, create_user),
status = COALESCE(status, 1),
@@ -31,7 +31,7 @@ BEGIN
SELECT count(*) INTO v_total_cnt FROM train_teacher;
SELECT count(*) INTO v_unmigrated_cnt
FROM train_teacher
WHERE org_name IS NULL OR status IS NULL OR del_flag IS NULL;
WHERE dept_name IS NULL OR status IS NULL OR del_flag IS NULL;
IF v_total_cnt <> 1 THEN
RAISE EXCEPTION '>>> [008-FATAL] 教师数据校验异常: 期望精确 1 条数据,实际检测到 % 条', v_total_cnt;