Browse Source

[Fix-5876][SQL] Support more resources files in the task (#6457)

* change the type of resource_ids from varchar to text
3.0.0/version-upgrade
Hua Jiang 3 years ago committed by GitHub
parent
commit
ba4cb9d22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      sql/dolphinscheduler_h2.sql
  2. 4
      sql/dolphinscheduler_mysql.sql
  3. 4
      sql/dolphinscheduler_postgre.sql
  4. 7
      sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
  5. 4
      sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql

4
sql/dolphinscheduler_h2.sql

@ -475,7 +475,7 @@ CREATE TABLE t_ds_task_definition
timeout_notify_strategy tinyint(4) DEFAULT NULL, timeout_notify_strategy tinyint(4) DEFAULT NULL,
timeout int(11) DEFAULT '0', timeout int(11) DEFAULT '0',
delay_time int(11) DEFAULT '0', delay_time int(11) DEFAULT '0',
resource_ids varchar(255) DEFAULT NULL, resource_ids text,
create_time datetime NOT NULL, create_time datetime NOT NULL,
update_time datetime DEFAULT NULL, update_time datetime DEFAULT NULL,
PRIMARY KEY (id, code) PRIMARY KEY (id, code)
@ -506,7 +506,7 @@ CREATE TABLE t_ds_task_definition_log
timeout_notify_strategy tinyint(4) DEFAULT NULL, timeout_notify_strategy tinyint(4) DEFAULT NULL,
timeout int(11) DEFAULT '0', timeout int(11) DEFAULT '0',
delay_time int(11) DEFAULT '0', delay_time int(11) DEFAULT '0',
resource_ids varchar(255) DEFAULT NULL, resource_ids text,
operator int(11) DEFAULT NULL, operator int(11) DEFAULT NULL,
operate_time datetime DEFAULT NULL, operate_time datetime DEFAULT NULL,
create_time datetime NOT NULL, create_time datetime NOT NULL,

4
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_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail',
`timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute', `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
`delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,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', `create_time` datetime NOT NULL COMMENT 'create time',
`update_time` datetime DEFAULT NULL COMMENT 'update time', `update_time` datetime DEFAULT NULL COMMENT 'update time',
PRIMARY KEY (`id`,`code`) PRIMARY KEY (`id`,`code`)
@ -504,7 +504,7 @@ CREATE TABLE `t_ds_task_definition_log` (
`timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail', `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', `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
`delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,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', `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
`operate_time` datetime DEFAULT NULL COMMENT 'operate time', `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
`create_time` datetime NOT NULL COMMENT 'create time', `create_time` datetime NOT NULL COMMENT 'create time',

4
sql/dolphinscheduler_postgre.sql

@ -382,7 +382,7 @@ CREATE TABLE t_ds_task_definition (
timeout_notify_strategy int DEFAULT NULL , timeout_notify_strategy int DEFAULT NULL ,
timeout int DEFAULT '0' , timeout int DEFAULT '0' ,
delay_time int DEFAULT '0' , delay_time int DEFAULT '0' ,
resource_ids varchar(255) DEFAULT NULL , resource_ids text ,
create_time timestamp DEFAULT NULL , create_time timestamp DEFAULT NULL ,
update_time timestamp DEFAULT NULL , update_time timestamp DEFAULT NULL ,
PRIMARY KEY (id) PRIMARY KEY (id)
@ -411,7 +411,7 @@ CREATE TABLE t_ds_task_definition_log (
timeout_notify_strategy int DEFAULT NULL , timeout_notify_strategy int DEFAULT NULL ,
timeout int DEFAULT '0' , timeout int DEFAULT '0' ,
delay_time int DEFAULT '0' , delay_time int DEFAULT '0' ,
resource_ids varchar(255) DEFAULT NULL , resource_ids text ,
operator int DEFAULT NULL , operator int DEFAULT NULL ,
operate_time timestamp DEFAULT NULL , operate_time timestamp DEFAULT NULL ,
create_time timestamp DEFAULT NULL , create_time timestamp DEFAULT NULL ,

7
sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql

@ -398,7 +398,7 @@ CREATE TABLE `t_ds_task_definition` (
`timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail', `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', `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
`delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,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', `create_time` datetime NOT NULL COMMENT 'create time',
`update_time` datetime DEFAULT NULL COMMENT 'update time', `update_time` datetime DEFAULT NULL COMMENT 'update time',
PRIMARY KEY (`id`,`code`) PRIMARY KEY (`id`,`code`)
@ -428,7 +428,7 @@ CREATE TABLE `t_ds_task_definition_log` (
`timeout_notify_strategy` tinyint(4) DEFAULT NULL COMMENT 'timeout notification policy: 0 warning, 1 fail', `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', `timeout` int(11) DEFAULT '0' COMMENT 'timeout length,unit: minute',
`delay_time` int(11) DEFAULT '0' COMMENT 'delay execution time,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', `operator` int(11) DEFAULT NULL COMMENT 'operator user id',
`operate_time` datetime DEFAULT NULL COMMENT 'operate time', `operate_time` datetime DEFAULT NULL COMMENT 'operate time',
`create_time` datetime NOT NULL COMMENT 'create time', `create_time` datetime NOT NULL COMMENT 'create time',
@ -443,6 +443,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_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_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 -- Table structure for t_ds_environment_worker_group_relation
-- ---------------------------- -- ----------------------------

4
sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql

@ -396,6 +396,10 @@ delimiter ;
SELECT uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName(); SELECT uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName();
DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName(); DROP FUNCTION IF EXISTS uc_dolphin_T_t_ds_task_definition_A_drop_UN_taskName();
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 -- 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
-- ---------------------------- -- ----------------------------

Loading…
Cancel
Save