safety-eval-service/docs/db/increment-org-personnel-lea...

23 lines
1.2 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

-- =============================================
-- org_personnel 表新增字段 - 技术负责人/过程控制负责人标识
-- 日期: 2026-07-14
-- 执行: mysql -u<user> -p<db> < increment-org-personnel-leader-flags-20260714.sql
-- =============================================
SET NAMES utf8mb4;
ALTER TABLE `org_personnel`
ADD COLUMN `technical_director_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否技术负责人(0否1是)' AFTER `proof_material_url`,
ADD COLUMN `process_control_leader_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否过程控制负责人(0否1是)' AFTER `technical_director_flag`;
-- 1. org_personnel 表title_name → title_code
ALTER TABLE `org_personnel` CHANGE COLUMN `title_name` `title_code` varchar(50) DEFAULT NULL COMMENT '职称';
-- 2. qual_filing_personnel 表title_name → title_code
ALTER TABLE `qual_filing_personnel` CHANGE COLUMN `title_name` `title_code` varchar(50) DEFAULT NULL COMMENT '职称';
-- 3. qual_filing_personnel_change 表title_name → title_code如表已存在
ALTER TABLE `qual_filing_personnel_change` CHANGE COLUMN `title_name` `title_code` varchar(50) DEFAULT NULL COMMENT '职称';