diff --git a/docs/db/increment-org-equipment-industry-code-20260715.sql b/docs/db/increment-org-equipment-industry-code-20260715.sql new file mode 100644 index 0000000..e137fb0 --- /dev/null +++ b/docs/db/increment-org-equipment-industry-code-20260715.sql @@ -0,0 +1,23 @@ +-- ============================================= +-- 2026-07-15 表字段变更增量脚本 +-- 执行: mysql -u -p < increment-org-equipment-industry-code-20260715.sql +-- ============================================= + +SET NAMES utf8mb4; + +-- ============================================= +-- org_equipment 表 +-- ============================================= + +-- 1. instrument_type_code → industry_code 行业code +ALTER TABLE `org_equipment` CHANGE COLUMN `instrument_type_code` `industry_code` varchar(32) DEFAULT NULL COMMENT '行业code'; + +-- ============================================= +-- org_business_scope_device_ref 表 +-- ============================================= + +-- 2. device_code → device_type_code 设备类型code +ALTER TABLE `org_business_scope_device_ref` CHANGE COLUMN `device_code` `device_type_code` varchar(32) DEFAULT NULL COMMENT '设备类型code'; + +-- 3. device_name → device_type_name 设备类型名称 +ALTER TABLE `org_business_scope_device_ref` CHANGE COLUMN `device_name` `device_type_name` varchar(200) DEFAULT NULL COMMENT '设备类型名称';