Files
shanxia2.0/docs/sql/migrations/2026-10-30-dispatch-calendar-site-kind.sql

19 lines
646 B
SQL

-- 手工派车日历增加 site(现场日历)。仅更新 COMMENT,无结构变更。
-- MySQL 5.7 / utf8mb4。可重复执行。
SET NAMES utf8mb4;
SET @col_exists = (
SELECT COUNT(*) FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'pl_dispatch_calendar'
AND COLUMN_NAME = 'calendar_kind'
);
SET @ddl = IF(
@col_exists = 1,
'ALTER TABLE `pl_dispatch_calendar` MODIFY COLUMN `calendar_kind` varchar(16) NOT NULL DEFAULT ''acid'' COMMENT ''日历类型:acid酸派车 alkali碱派车 other其他 site现场''',
'SELECT 1'
);
PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;