You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by le...@apache.org on 2021/10/14 08:26:38 UTC

[dolphinscheduler] branch 2.0-prepare updated: [cherry-pick-2.0][Fix-5876][SQL] Support more resources files in the task (#6530)

This is an automated email from the ASF dual-hosted git repository.

leonbao pushed a commit to branch 2.0-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/2.0-prepare by this push:
     new 3bd2b91  [cherry-pick-2.0][Fix-5876][SQL] Support more resources files in the task (#6530)
3bd2b91 is described below

commit 3bd2b91d0595660bf3a03b2bdc45eeba5e22ed14
Author: Kerwin <37...@users.noreply.github.com>
AuthorDate: Thu Oct 14 16:26:27 2021 +0800

    [cherry-pick-2.0][Fix-5876][SQL] Support more resources files in the task (#6530)
    
    * Support more resources files in the task.
    
    * Support more resources files in the task.
    
    Co-authored-by: Hua Jiang <ji...@163.com>
---
 sql/dolphinscheduler_h2.sql                                  | 4 ++--
 sql/dolphinscheduler_mysql.sql                               | 4 ++--
 sql/dolphinscheduler_postgre.sql                             | 4 ++--
 sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql      | 7 +++++--
 sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql | 3 +++
 5 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/sql/dolphinscheduler_h2.sql b/sql/dolphinscheduler_h2.sql
index c2394ef..6a74655 100644
--- a/sql/dolphinscheduler_h2.sql
+++ b/sql/dolphinscheduler_h2.sql
@@ -475,7 +475,7 @@ CREATE TABLE t_ds_task_definition
     timeout_notify_strategy tinyint(4) DEFAULT NULL,
     timeout                 int(11) DEFAULT '0',
     delay_time              int(11) DEFAULT '0',
-    resource_ids            varchar(255) DEFAULT NULL,
+    resource_ids            text,
     create_time             datetime    NOT NULL,
     update_time             datetime     DEFAULT NULL,
     PRIMARY KEY (id, code),
@@ -507,7 +507,7 @@ CREATE TABLE t_ds_task_definition_log
     timeout_notify_strategy tinyint(4) DEFAULT NULL,
     timeout                 int(11) DEFAULT '0',
     delay_time              int(11) DEFAULT '0',
-    resource_ids            varchar(255) DEFAULT NULL,
+    resource_ids            text,
     operator                int(11) DEFAULT NULL,
     operate_time            datetime     DEFAULT NULL,
     create_time             datetime    NOT NULL,
diff --git a/sql/dolphinscheduler_mysql.sql b/sql/dolphinscheduler_mysql.sql
index a54e873..4124985 100644
--- a/sql/dolphinscheduler_mysql.sql
+++ b/sql/dolphinscheduler_mysql.sql
@@ -474,7 +474,7 @@ CREATE TABLE `t_ds_task_definition` (
   `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
   `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
   `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
-  `resource_ids` varchar(255) DEFAULT NULL COMMENT 'resource id, separated by comma',
+  `resource_ids` text COMMENT 'resource id, separated by comma',
   `create_time` datetime NOT NULL COMMENT 'create time',
   `update_time` datetime DEFAULT NULL COMMENT 'update time',
   PRIMARY KEY (`id`,`code`),
@@ -505,7 +505,7 @@ CREATE TABLE `t_ds_task_definition_log` (
   `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
   `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
   `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
-  `resource_ids` varchar(255) DEFAULT NULL COMMENT 'resource id, separated by comma',
+  `resource_ids` text DEFAULT NULL COMMENT 'resource id, separated by comma',
   `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
   `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
   `create_time` datetime NOT NULL COMMENT 'create time',
diff --git a/sql/dolphinscheduler_postgre.sql b/sql/dolphinscheduler_postgre.sql
index 2f02cf2..130280d 100644
--- a/sql/dolphinscheduler_postgre.sql
+++ b/sql/dolphinscheduler_postgre.sql
@@ -382,7 +382,7 @@ CREATE TABLE t_ds_task_definition (
   timeout_notify_strategy int DEFAULT NULL ,
   timeout int DEFAULT '0' ,
   delay_time int DEFAULT '0' ,
-  resource_ids varchar(255) DEFAULT NULL ,
+  resource_ids text ,
   create_time timestamp DEFAULT NULL ,
   update_time timestamp DEFAULT NULL ,
   PRIMARY KEY (id) ,
@@ -412,7 +412,7 @@ CREATE TABLE t_ds_task_definition_log (
   timeout_notify_strategy int DEFAULT NULL ,
   timeout int DEFAULT '0' ,
   delay_time int DEFAULT '0' ,
-  resource_ids varchar(255) DEFAULT NULL ,
+  resource_ids text ,
   operator int DEFAULT NULL ,
   operate_time timestamp DEFAULT NULL ,
   create_time timestamp DEFAULT NULL ,
diff --git a/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql b/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
index 1dc9097..c937340 100644
--- a/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
+++ b/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
@@ -379,7 +379,7 @@ CREATE TABLE `t_ds_task_definition` (
   `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
   `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
   `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
-  `resource_ids` varchar(255) DEFAULT NULL COMMENT 'resource id, separated by comma',
+  `resource_ids` text COMMENT 'resource id, separated by comma',
   `create_time` datetime NOT NULL COMMENT 'create time',
   `update_time` datetime DEFAULT NULL COMMENT 'update time',
   PRIMARY KEY (`id`,`code`),
@@ -410,7 +410,7 @@ CREATE TABLE `t_ds_task_definition_log` (
   `timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
   `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
   `delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,unit: minute',
-  `resource_ids` varchar(255) DEFAULT NULL COMMENT 'resource id, separated by comma',
+  `resource_ids` text COMMENT 'resource id, separated by comma',
   `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
   `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
   `create_time` datetime NOT NULL COMMENT 'create time',
@@ -425,6 +425,9 @@ ALTER TABLE t_ds_process_instance ADD COLUMN `environment_code` bigint(20) defau
 ALTER TABLE t_ds_task_instance ADD COLUMN `environment_code` bigint(20) default '-1' COMMENT 'environment code' AFTER `worker_group`;
 ALTER TABLE t_ds_task_instance ADD COLUMN `environment_config` text COMMENT 'environment config' AFTER `environment_code`;
 
+ALTER TABLE t_ds_task_definition MODIFY COLUMN `resource_ids` text;
+ALTER TABLE t_ds_task_definition_log MODIFY COLUMN `resource_ids` text;
+
 -- ----------------------------
 -- Table structure for t_ds_environment_worker_group_relation
 -- ----------------------------
diff --git a/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql b/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql
index ce9a3f2..2bd2431 100644
--- a/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql
+++ b/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql
@@ -379,6 +379,9 @@ CREATE TABLE t_ds_environment_worker_group_relation (
     CONSTRAINT environment_worker_group_unique UNIQUE (environment_code,worker_group)
 );
 
+ALTER TABLE t_ds_task_definition ALTER COLUMN resource_ids TYPE text;
+ALTER TABLE t_ds_task_definition_log ALTER COLUMN resource_ids TYPE text;
+
 -- ----------------------------
 -- These columns will not be used in the new version,if you determine that the historical data is useless, you can delete it using the sql below
 -- ----------------------------