From 281cea8a64c2c15a124c8bdbe121026a97b8561d Mon Sep 17 00:00:00 2001 From: wind Date: Thu, 23 Dec 2021 11:43:11 +0800 Subject: [PATCH] fix 2.0.2 upgrade sql (#7566) Co-authored-by: caishunfeng <534328519@qq.com> --- .../mysql/dolphinscheduler_ddl.sql | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.2_schema/mysql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.2_schema/mysql/dolphinscheduler_ddl.sql index c7a2396fa4..2525b3ce8e 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.2_schema/mysql/dolphinscheduler_ddl.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.2_schema/mysql/dolphinscheduler_ddl.sql @@ -17,4 +17,22 @@ SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); -alter table t_ds_process_instance add column if not exists `restart_time` datetime DEFAULT NULL COMMENT 'process instance restart time'; \ No newline at end of file +-- uc_dolphin_T_t_ds_process_instance_A_restart_time +drop PROCEDURE if EXISTS uc_dolphin_T_t_ds_process_instance_A_restart_time; +delimiter d// +CREATE PROCEDURE uc_dolphin_T_t_ds_process_instance_A_restart_time() + BEGIN + IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_NAME='t_ds_process_instance' + AND TABLE_SCHEMA=(SELECT DATABASE()) + AND COLUMN_NAME ='restart_time') + THEN + ALTER TABLE t_ds_process_instance ADD COLUMN `restart_time` datetime DEFAULT NULL COMMENT 'process instance restart time'; + END IF; + END; + +d// + +delimiter ; +CALL uc_dolphin_T_t_ds_process_instance_A_restart_time(); +DROP PROCEDURE uc_dolphin_T_t_ds_process_instance_A_restart_time; \ No newline at end of file