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 2b8d4942ce..4537604e0a 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 e68781b545..569ff693ef 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;