Files
ai_academy/migrations/versioned/000136_training_demand_lecturer.up.sql
T

13 lines
710 B
SQL

-- Migration: 000136_training_demand_lecturer
-- Description: 年度需求收集增强:
-- 1) tr_demands 增加 lecturer_id 列(讲师,选填,关联 users.id,与课程/场次一致);
-- 2) 部门为必填口径(按提报人 tr_members.dept_id 自动获取),不新增列,仅注释说明。
DO $$ BEGIN RAISE NOTICE '[Migration 000136] Starting training-demand lecturer setup...'; END $$;
ALTER TABLE tr_demands
ADD COLUMN IF NOT EXISTS lecturer_id VARCHAR(36) NOT NULL DEFAULT '';
COMMENT ON TABLE tr_demands IS '年度需求提报;dept_id 必填(按提报人所在部门自动获取),lecturer_id 选填';
DO $$ BEGIN RAISE NOTICE '[Migration 000136] Training-demand lecturer column ready.'; END $$;