-- 为 work_plan 表添加审批相关字段
-- 审批状态：0待审核，1已通过，2已驳回
-- 审批人、审批时间、审批意见

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- 添加审批状态字段
ALTER TABLE `work_plan` 
ADD COLUMN `approval_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '审批状态：0待审核，1已通过，2已驳回' AFTER `project_status`;

-- 添加审批人字段
ALTER TABLE `work_plan` 
ADD COLUMN `approver` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '审批人' AFTER `approval_status`;

-- 添加审批时间字段
ALTER TABLE `work_plan` 
ADD COLUMN `approval_time` datetime(0) DEFAULT NULL COMMENT '审批时间' AFTER `approver`;

-- 添加审批意见字段
ALTER TABLE `work_plan` 
ADD COLUMN `approval_comment` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '审批意见' AFTER `approval_time`;

SET FOREIGN_KEY_CHECKS = 1;
