|
|
@@ -59,7 +59,35 @@ END IF;
|
|
|
END IF;
|
|
|
|
|
|
|
|
|
-
|
|
|
+IF
|
|
|
+ NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE () AND TABLE_NAME = 'core_resumption_plan' AND COLUMN_NAME = 'solid_id' ) THEN
|
|
|
+ ALTER TABLE `core_resumption_plan`
|
|
|
+ MODIFY COLUMN `parent_id` bigint NULL DEFAULT -1 COMMENT '下发父计划id' AFTER `id`,
|
|
|
+ ADD COLUMN `solid_id` bigint NULL COMMENT '固定的id,用于识别多个副本是否属于同一个计划' AFTER `parent_id`,
|
|
|
+ ADD COLUMN `parent_solid_id` bigint NULL COMMENT '固定的parentid,用于识别多个副本是否属于同一个计划' AFTER `solid_id`;
|
|
|
+ END IF;
|
|
|
+ IF
|
|
|
+ NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE () AND TABLE_NAME = 'core_resumption' AND COLUMN_NAME = 'solid_id' ) THEN
|
|
|
+ ALTER TABLE `core_resumption`
|
|
|
+ ADD COLUMN `solid_id` bigint NULL COMMENT '固定的id,用于识别多个副本是否属于同一个计划' AFTER `plan_id`,
|
|
|
+ ADD COLUMN `parent_solid_id` bigint NULL COMMENT '固定的parentid,用于识别多个副本是否属于同一个计划' AFTER `solid_id`;
|
|
|
+ END IF;
|
|
|
+ IF
|
|
|
+ EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE () AND TABLE_NAME = 'core_resumption_plan_to_point' AND COLUMN_NAME = 'effective_date' ) THEN
|
|
|
+ ALTER TABLE `core_resumption_plan_to_point`
|
|
|
+ DROP COLUMN `effective_date`;
|
|
|
+ END IF;
|
|
|
+
|
|
|
+ IF
|
|
|
+ NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE () AND TABLE_NAME = 'core_resumption_plan' AND COLUMN_NAME = 'publish_time' ) THEN
|
|
|
+ ALTER TABLE `core_resumption_plan`
|
|
|
+ ADD COLUMN `publish_time` datetime NULL COMMENT '最后一次下发时间' AFTER `task_has_completed`,
|
|
|
+ ADD COLUMN `withdraw_time` datetime NULL COMMENT '最后一次撤回时间' AFTER `publish_time`,
|
|
|
+ ADD COLUMN `effective_time` datetime NULL COMMENT '计划生效时间' AFTER `withdraw_time`;
|
|
|
+ update core_resumption_plan set publish_time =update_time WHERE publish_time is null and plan_status=1;
|
|
|
+ update core_resumption_plan set withdraw_time =update_time WHERE withdraw_time is null and plan_status=2;
|
|
|
+ update core_resumption_plan set effective_time =update_time WHERE effective_time is null and plan_status=1;
|
|
|
+ END IF;
|
|
|
|
|
|
END ??
|
|
|
DELIMITER;
|