You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ji...@apache.org on 2021/11/12 04:03:28 UTC

[dolphinscheduler] branch dev updated: [feature][Install] 6597 add worker group when upgrading from version 1.x to 2.0 (#6806)

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

jinyleechina pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new d168a3c  [feature][Install] 6597 add worker group when upgrading from version 1.x to 2.0 (#6806)
d168a3c is described below

commit d168a3cdf7cec9689dc8ae439c4a02ab10922287
Author: OS <29...@users.noreply.github.com>
AuthorDate: Fri Nov 12 12:03:23 2021 +0800

    [feature][Install] 6597 add worker group when upgrading from version 1.x to 2.0 (#6806)
    
    * feature 6597 add worker group. Upgrade dolphinscheduler version 1. X to version 2.0
    
    * feature 6597 add worker group. Upgrade dolphinscheduler version 1. X to version 2.0
    
    * code style
    
    * code style
    
    * code style
    
    * code style
    
    * update postgre sql
    
    Co-authored-by: JinYong Li <42...@users.noreply.github.com>
---
 .../upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql   | 12 ++++++++++++
 .../2.0.0_schema/postgresql/dolphinscheduler_ddl.sql      | 15 +++++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql
index 2b8d494..4537604 100644
--- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql
+++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/mysql/dolphinscheduler_ddl.sql
@@ -352,6 +352,18 @@ CREATE TABLE `t_ds_process_task_relation_log` (
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
 
+-- t_ds_worker_group
+DROP TABLE IF EXISTS `t_ds_worker_group`;
+CREATE TABLE `t_ds_worker_group` (
+  `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `name` varchar(255) NOT NULL COMMENT 'worker group name',
+  `addr_list` text NULL DEFAULT NULL COMMENT 'worker addr list. split by [,]',
+  `create_time` datetime NULL DEFAULT NULL COMMENT 'create time',
+  `update_time` datetime NULL DEFAULT NULL COMMENT 'update time',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `name_unique` (`name`)
+) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
+
 -- t_ds_command
 alter table t_ds_command change process_definition_id process_definition_code bigint(20) NOT NULL COMMENT 'process definition code';
 alter table t_ds_command add environment_code bigint(20) DEFAULT '-1' COMMENT 'environment code' AFTER worker_group;
diff --git a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/postgresql/dolphinscheduler_ddl.sql b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/postgresql/dolphinscheduler_ddl.sql
index e68781b..569ff69 100644
--- a/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/postgresql/dolphinscheduler_ddl.sql
+++ b/dolphinscheduler-dao/src/main/resources/sql/upgrade/2.0.0_schema/postgresql/dolphinscheduler_ddl.sql
@@ -210,7 +210,7 @@ BEGIN
 	)';
 
 	EXECUTE 'CREATE TABLE IF NOT EXISTS '|| quote_ident(v_schema) ||'."t_ds_task_definition" (
-	  id int NOT NULL  ,
+	  id serial NOT NULL  ,
 	  code bigint NOT NULL,
 	  name varchar(255) DEFAULT NULL ,
 	  version int NOT NULL ,
@@ -264,7 +264,7 @@ BEGIN
 	)';
 
 	EXECUTE 'CREATE TABLE IF NOT EXISTS '|| quote_ident(v_schema) ||'."t_ds_process_task_relation" (
-	  id int NOT NULL  ,
+	  id serial NOT NULL  ,
 	  name varchar(255) DEFAULT NULL ,
 	  project_code bigint DEFAULT NULL ,
 	  process_definition_code bigint DEFAULT NULL ,
@@ -298,6 +298,17 @@ BEGIN
 	  update_time timestamp DEFAULT NULL ,
 	  PRIMARY KEY (id)
 	)';
+
+	EXECUTE 'CREATE TABLE IF NOT EXISTS '|| quote_ident(v_schema) ||'."t_ds_worker_group" (
+      id serial NOT NULL,
+      name varchar(255) NOT NULL,
+      addr_list text DEFAULT NULL,
+      create_time timestamp DEFAULT NULL,
+      update_time timestamp DEFAULT NULL,
+      PRIMARY KEY (id),
+      UNIQUE KEY name_unique (name)
+	)';
+
 	return 'Success!';
 	exception when others then
 		---Raise EXCEPTION '(%)',SQLERRM;