diff --git a/sql/dolphinscheduler_h2.sql b/sql/dolphinscheduler_h2.sql index df39d90f2b..f98295aac2 100644 --- a/sql/dolphinscheduler_h2.sql +++ b/sql/dolphinscheduler_h2.sql @@ -326,7 +326,7 @@ CREATE TABLE t_ds_command update_time datetime DEFAULT NULL, process_instance_priority int(11) DEFAULT NULL, worker_group varchar(64), - environment_code bigint(20) DEFAULT NULL, + environment_code bigint(20) DEFAULT '-1', PRIMARY KEY (id) ); @@ -376,7 +376,7 @@ CREATE TABLE t_ds_error_command update_time datetime DEFAULT NULL, process_instance_priority int(11) DEFAULT NULL, worker_group varchar(64), - environment_code bigint(20) DEFAULT NULL, + environment_code bigint(20) DEFAULT '-1', message text, PRIMARY KEY (id) ); @@ -461,7 +461,7 @@ CREATE TABLE t_ds_task_definition flag tinyint(2) DEFAULT NULL, task_priority tinyint(4) DEFAULT NULL, worker_group varchar(200) DEFAULT NULL, - environment_code bigint(20) DEFAULT NULL, + environment_code bigint(20) DEFAULT '-1', fail_retry_times int(11) DEFAULT NULL, fail_retry_interval int(11) DEFAULT NULL, timeout_flag tinyint(2) DEFAULT '0', @@ -493,7 +493,7 @@ CREATE TABLE t_ds_task_definition_log flag tinyint(2) DEFAULT NULL, task_priority tinyint(4) DEFAULT NULL, worker_group varchar(200) DEFAULT NULL, - environment_code bigint(20) DEFAULT NULL, + environment_code bigint(20) DEFAULT '-1', fail_retry_times int(11) DEFAULT NULL, fail_retry_interval int(11) DEFAULT NULL, timeout_flag tinyint(2) DEFAULT '0', @@ -587,7 +587,7 @@ CREATE TABLE t_ds_process_instance history_cmd text, process_instance_priority int(11) DEFAULT NULL, worker_group varchar(64) DEFAULT NULL, - environment_code bigint(20) DEFAULT NULL, + environment_code bigint(20) DEFAULT '-1', timeout int(11) DEFAULT '0', tenant_id int(11) NOT NULL DEFAULT '-1', var_pool longtext, @@ -773,7 +773,7 @@ CREATE TABLE t_ds_schedules warning_group_id int(11) DEFAULT NULL, process_instance_priority int(11) DEFAULT NULL, worker_group varchar(64) DEFAULT '', - environment_code bigint(20) DEFAULT NULL, + environment_code bigint(20) DEFAULT '-1', create_time datetime NOT NULL, update_time datetime NOT NULL, PRIMARY KEY (id) @@ -829,7 +829,7 @@ CREATE TABLE t_ds_task_instance max_retry_times int(2) DEFAULT NULL, task_instance_priority int(11) DEFAULT NULL, worker_group varchar(64) DEFAULT NULL, - environment_code bigint(20) DEFAULT NULL, + environment_code bigint(20) DEFAULT '-1', environment_config text DEFAULT '', executor_id int(11) DEFAULT NULL, first_submit_time datetime DEFAULT NULL, diff --git a/sql/dolphinscheduler_postgre.sql b/sql/dolphinscheduler_postgre.sql index d1b8822128..f1ac87709e 100644 --- a/sql/dolphinscheduler_postgre.sql +++ b/sql/dolphinscheduler_postgre.sql @@ -232,7 +232,7 @@ CREATE TABLE t_ds_command ( update_time timestamp DEFAULT NULL , process_instance_priority int DEFAULT NULL , worker_group varchar(64), - environment_code bigint DEFAULT NULL, + environment_code bigint DEFAULT '-1', PRIMARY KEY (id) ) ; @@ -274,7 +274,7 @@ CREATE TABLE t_ds_error_command ( update_time timestamp DEFAULT NULL , process_instance_priority int DEFAULT NULL , worker_group varchar(64), - environment_code bigint DEFAULT NULL, + environment_code bigint DEFAULT '-1', message text , PRIMARY KEY (id) ); @@ -347,7 +347,7 @@ CREATE TABLE t_ds_task_definition ( flag int DEFAULT NULL , task_priority int DEFAULT NULL , worker_group varchar(255) DEFAULT NULL , - environment_code bigint DEFAULT NULL, + environment_code bigint DEFAULT '-1', fail_retry_times int DEFAULT NULL , fail_retry_interval int DEFAULT NULL , timeout_flag int DEFAULT NULL , @@ -377,7 +377,7 @@ CREATE TABLE t_ds_task_definition_log ( flag int DEFAULT NULL , task_priority int DEFAULT NULL , worker_group varchar(255) DEFAULT NULL , - environment_code bigint DEFAULT NULL, + environment_code bigint DEFAULT '-1', fail_retry_times int DEFAULT NULL , fail_retry_interval int DEFAULT NULL , timeout_flag int DEFAULT NULL , @@ -465,7 +465,7 @@ CREATE TABLE t_ds_process_instance ( dependence_schedule_times text , process_instance_priority int DEFAULT NULL , worker_group varchar(64) , - environment_code bigint DEFAULT NULL, + environment_code bigint DEFAULT '-1', timeout int DEFAULT '0' , tenant_id int NOT NULL DEFAULT '-1' , var_pool text , @@ -626,7 +626,7 @@ CREATE TABLE t_ds_schedules ( warning_group_id int DEFAULT NULL , process_instance_priority int DEFAULT NULL , worker_group varchar(64), - environment_code bigint DEFAULT NULL, + environment_code bigint DEFAULT '-1', create_time timestamp NOT NULL , update_time timestamp NOT NULL , PRIMARY KEY (id) @@ -674,7 +674,7 @@ CREATE TABLE t_ds_task_instance ( max_retry_times int DEFAULT NULL , task_instance_priority int DEFAULT NULL , worker_group varchar(64), - environment_code bigint DEFAULT NULL, + environment_code bigint DEFAULT '-1', environment_config text, executor_id int DEFAULT NULL , first_submit_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 5dc7eb6edb..6726663dea 100644 --- a/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql +++ b/sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql @@ -355,14 +355,14 @@ CREATE TABLE `t_ds_environment` ( UNIQUE KEY `environment_code_unique` (`code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -ALTER TABLE t_ds_task_definition ADD COLUMN `environment_code` bigint(20) default NULL COMMENT 'environment code' AFTER `worker_group`; -ALTER TABLE t_ds_task_definition_log ADD COLUMN `environment_code` bigint(20) default NULL COMMENT 'environment code' AFTER `worker_group`; - -ALTER TABLE t_ds_command ADD COLUMN `environment_code` bigint(20) default NULL COMMENT 'environment code' AFTER `worker_group`; -ALTER TABLE t_ds_error_command ADD COLUMN `environment_code` bigint(20) default NULL COMMENT 'environment code' AFTER `worker_group`; -ALTER TABLE t_ds_schedules ADD COLUMN `environment_code` bigint(20) default NULL COMMENT 'environment code' AFTER `worker_group`; -ALTER TABLE t_ds_process_instance ADD COLUMN `environment_code` bigint(20) default NULL COMMENT 'environment code' AFTER `worker_group`; -ALTER TABLE t_ds_task_instance ADD COLUMN `environment_code` bigint(20) default NULL COMMENT 'environment code' AFTER `worker_group`; +ALTER TABLE t_ds_task_definition ADD COLUMN `environment_code` bigint(20) default '-1' COMMENT 'environment code' AFTER `worker_group`; +ALTER TABLE t_ds_task_definition_log ADD COLUMN `environment_code` bigint(20) default '-1' COMMENT 'environment code' AFTER `worker_group`; + +ALTER TABLE t_ds_command ADD COLUMN `environment_code` bigint(20) default '-1' COMMENT 'environment code' AFTER `worker_group`; +ALTER TABLE t_ds_error_command ADD COLUMN `environment_code` bigint(20) default '-1' COMMENT 'environment code' AFTER `worker_group`; +ALTER TABLE t_ds_schedules ADD COLUMN `environment_code` bigint(20) default '-1' COMMENT 'environment code' AFTER `worker_group`; +ALTER TABLE t_ds_process_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`; -- ---------------------------- 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 6339ec4282..ce9a3f2139 100644 --- a/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql +++ b/sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql @@ -340,25 +340,25 @@ CREATE TABLE t_ds_environment ( CONSTRAINT environment_code_unique UNIQUE (code) ); -ALTER TABLE t_ds_task_definition ADD COLUMN environment_code bigint DEFAULT NULL; +ALTER TABLE t_ds_task_definition ADD COLUMN environment_code bigint DEFAULT '-1'; comment on column t_ds_task_definition.environment_code is 'environment code'; -ALTER TABLE t_ds_task_definition_log ADD COLUMN environment_code bigint DEFAULT NULL; +ALTER TABLE t_ds_task_definition_log ADD COLUMN environment_code bigint DEFAULT '-1'; comment on column t_ds_task_definition_log.environment_code is 'environment code'; -ALTER TABLE t_ds_command ADD COLUMN environment_code bigint DEFAULT NULL; +ALTER TABLE t_ds_command ADD COLUMN environment_code bigint DEFAULT '-1'; comment on column t_ds_command.environment_code is 'environment code'; -ALTER TABLE t_ds_error_command ADD COLUMN environment_code bigint DEFAULT NULL; +ALTER TABLE t_ds_error_command ADD COLUMN environment_code bigint DEFAULT '-1'; comment on column t_ds_error_command.environment_code is 'environment code'; -ALTER TABLE t_ds_schedules ADD COLUMN environment_code bigint DEFAULT NULL; +ALTER TABLE t_ds_schedules ADD COLUMN environment_code bigint DEFAULT '-1'; comment on column t_ds_schedules.environment_code is 'environment code'; -ALTER TABLE t_ds_process_instance ADD COLUMN environment_code bigint DEFAULT NULL; +ALTER TABLE t_ds_process_instance ADD COLUMN environment_code bigint DEFAULT '-1'; comment on column t_ds_process_instance.environment_code is 'environment code'; -ALTER TABLE t_ds_task_instance ADD COLUMN environment_code bigint DEFAULT NULL; +ALTER TABLE t_ds_task_instance ADD COLUMN environment_code bigint DEFAULT '-1'; comment on column t_ds_task_instance.environment_code is 'environment code'; ALTER TABLE t_ds_task_instance ADD COLUMN environment_config text;