diff --git a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql index 94f8e9a87706..402ad42695be 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_h2.sql @@ -803,6 +803,21 @@ CREATE TABLE t_ds_relation_resources_user -- Records of t_ds_relation_resources_user -- ---------------------------- +-- ---------------------------- +-- Table structure for t_ds_relation_udfs_user +-- ---------------------------- +DROP TABLE IF EXISTS t_ds_relation_udfs_user CASCADE; +CREATE TABLE t_ds_relation_udfs_user +( + id int(11) NOT NULL AUTO_INCREMENT, + user_id int(11) NOT NULL, + udf_id int(11) DEFAULT NULL, + perm int(11) DEFAULT '1', + create_time datetime DEFAULT NULL, + update_time datetime DEFAULT NULL, + PRIMARY KEY (id) +); + -- ---------------------------- -- Table structure for t_ds_resources -- ---------------------------- @@ -952,6 +967,32 @@ CREATE TABLE t_ds_tenant INSERT IGNORE INTO `t_ds_tenant` VALUES ('-1', 'default', 'default tenant', '1', current_timestamp, current_timestamp); +-- ---------------------------- +-- Table structure for t_ds_udfs +-- ---------------------------- +DROP TABLE IF EXISTS t_ds_udfs CASCADE; +CREATE TABLE t_ds_udfs +( + id int(11) NOT NULL AUTO_INCREMENT, + user_id int(11) NOT NULL, + func_name varchar(100) NOT NULL, + class_name varchar(255) NOT NULL, + type tinyint(4) NOT NULL, + arg_types varchar(255) DEFAULT NULL, + database varchar(255) DEFAULT NULL, + description varchar(255) DEFAULT NULL, + resource_id int(11) NOT NULL, + resource_name varchar(255) NOT NULL, + create_time datetime NOT NULL, + update_time datetime NOT NULL, + PRIMARY KEY (id), + UNIQUE KEY unique_func_name (func_name) +); + +-- ---------------------------- +-- Records of t_ds_udfs +-- ---------------------------- + -- ---------------------------- -- Table structure for t_ds_user -- ---------------------------- @@ -1941,35 +1982,35 @@ CREATE TABLE t_ds_environment_worker_group_relation DROP TABLE IF EXISTS t_ds_task_group_queue; CREATE TABLE t_ds_task_group_queue ( - id int(11) NOT NULL AUTO_INCREMENT , - task_id int(11) DEFAULT NULL , - task_name VARCHAR(255) DEFAULT NULL , - group_id int(11) DEFAULT NULL , - process_id int(11) DEFAULT NULL , - priority int(8) DEFAULT '0' , - status int(4) DEFAULT '-1' , - force_start int(4) DEFAULT '0' , - in_queue int(4) DEFAULT '0' , - create_time datetime DEFAULT NULL , - update_time datetime DEFAULT NULL , - KEY idx_t_ds_task_group_queue_in_queue (in_queue) , - PRIMARY KEY (id) + id int(11) NOT NULL AUTO_INCREMENT , + task_id int(11) DEFAULT NULL , + task_name VARCHAR(255) DEFAULT NULL , + group_id int(11) DEFAULT NULL , + process_id int(11) DEFAULT NULL , + priority int(8) DEFAULT '0' , + status int(4) DEFAULT '-1' , + force_start int(4) DEFAULT '0' , + in_queue int(4) DEFAULT '0' , + create_time datetime DEFAULT NULL , + update_time datetime DEFAULT NULL , + KEY idx_t_ds_task_group_queue_in_queue (in_queue) , + PRIMARY KEY (id) ); DROP TABLE IF EXISTS t_ds_task_group; CREATE TABLE t_ds_task_group ( - id int(11) NOT NULL AUTO_INCREMENT , - name varchar(255) DEFAULT NULL , - description varchar(255) DEFAULT NULL , - group_size int(11) NOT NULL , - project_code bigint(20) DEFAULT '0', - use_size int(11) DEFAULT '0' , - user_id int(11) DEFAULT NULL , - status int(4) DEFAULT '1' , - create_time datetime DEFAULT NULL , - update_time datetime DEFAULT NULL , - PRIMARY KEY(id) + id int(11) NOT NULL AUTO_INCREMENT , + name varchar(255) DEFAULT NULL , + description varchar(255) DEFAULT NULL , + group_size int(11) NOT NULL , + project_code bigint(20) DEFAULT '0', + use_size int(11) DEFAULT '0' , + user_id int(11) DEFAULT NULL , + status int(4) DEFAULT '1' , + create_time datetime DEFAULT NULL , + update_time datetime DEFAULT NULL , + PRIMARY KEY(id) ); -- ---------------------------- @@ -2005,15 +2046,15 @@ CREATE TABLE t_ds_k8s DROP TABLE IF EXISTS t_ds_k8s_namespace; CREATE TABLE t_ds_k8s_namespace ( - id int(11) NOT NULL AUTO_INCREMENT , - code bigint(20) NOT NULL, - namespace varchar(255) DEFAULT NULL, - user_id int(11) DEFAULT NULL, - cluster_code bigint(20) NOT NULL, - create_time datetime DEFAULT NULL , - update_time datetime DEFAULT NULL , - PRIMARY KEY (id) , - UNIQUE KEY k8s_namespace_unique (namespace,cluster_code) + id int(11) NOT NULL AUTO_INCREMENT , + code bigint(20) NOT NULL, + namespace varchar(255) DEFAULT NULL, + user_id int(11) DEFAULT NULL, + cluster_code bigint(20) NOT NULL, + create_time datetime DEFAULT NULL , + update_time datetime DEFAULT NULL , + PRIMARY KEY (id) , + UNIQUE KEY k8s_namespace_unique (namespace,cluster_code) ); -- ---------------------------- -- Records of t_ds_k8s_namespace @@ -2035,14 +2076,14 @@ VALUES (3, 990003, 'auth_test', 3, 0, '2020-03-03 11:31:24.0', '2020-03-03 11:31 -- ---------------------------- DROP TABLE IF EXISTS t_ds_relation_namespace_user; CREATE TABLE t_ds_relation_namespace_user ( - id int(11) NOT NULL AUTO_INCREMENT , - user_id int(11) NOT NULL , - namespace_id int(11) NOT NULL , - perm int(11) DEFAULT '1' , - create_time datetime DEFAULT NULL , - update_time datetime DEFAULT NULL , - PRIMARY KEY (id) , - UNIQUE KEY namespace_user_unique (user_id,namespace_id) + id int(11) NOT NULL AUTO_INCREMENT , + user_id int(11) NOT NULL , + namespace_id int(11) NOT NULL , + perm int(11) DEFAULT '1' , + create_time datetime DEFAULT NULL , + update_time datetime DEFAULT NULL , + PRIMARY KEY (id) , + UNIQUE KEY namespace_user_unique (user_id,namespace_id) ); -- ---------------------------- @@ -2116,14 +2157,14 @@ CREATE TABLE t_ds_trigger_relation DROP TABLE IF EXISTS t_ds_relation_sub_workflow; CREATE TABLE t_ds_relation_sub_workflow ( - id BIGINT AUTO_INCREMENT NOT NULL, - parent_workflow_instance_id BIGINT NOT NULL, - parent_task_code BIGINT NOT NULL, - sub_workflow_instance_id BIGINT NOT NULL, - PRIMARY KEY (id), - INDEX idx_parent_workflow_instance_id (parent_workflow_instance_id), - INDEX idx_parent_task_code (parent_task_code), - INDEX idx_sub_workflow_instance_id (sub_workflow_instance_id) + id BIGINT AUTO_INCREMENT NOT NULL, + parent_workflow_instance_id BIGINT NOT NULL, + parent_task_code BIGINT NOT NULL, + sub_workflow_instance_id BIGINT NOT NULL, + PRIMARY KEY (id), + INDEX idx_parent_workflow_instance_id (parent_workflow_instance_id), + INDEX idx_parent_task_code (parent_task_code), + INDEX idx_sub_workflow_instance_id (sub_workflow_instance_id) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; -- ---------------------------- diff --git a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql index 0e50f9cd07e9..fe1ab8c9d223 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql @@ -20,19 +20,19 @@ -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_JOB_DETAILS`; CREATE TABLE `QRTZ_JOB_DETAILS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `JOB_NAME` varchar(200) NOT NULL, - `JOB_GROUP` varchar(200) NOT NULL, - `DESCRIPTION` varchar(250) DEFAULT NULL, - `JOB_CLASS_NAME` varchar(250) NOT NULL, - `IS_DURABLE` varchar(1) NOT NULL, - `IS_NONCONCURRENT` varchar(1) NOT NULL, - `IS_UPDATE_DATA` varchar(1) NOT NULL, - `REQUESTS_RECOVERY` varchar(1) NOT NULL, - `JOB_DATA` blob, - PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`), - KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`) + `SCHED_NAME` varchar(120) NOT NULL, + `JOB_NAME` varchar(200) NOT NULL, + `JOB_GROUP` varchar(200) NOT NULL, + `DESCRIPTION` varchar(250) DEFAULT NULL, + `JOB_CLASS_NAME` varchar(250) NOT NULL, + `IS_DURABLE` varchar(1) NOT NULL, + `IS_NONCONCURRENT` varchar(1) NOT NULL, + `IS_UPDATE_DATA` varchar(1) NOT NULL, + `REQUESTS_RECOVERY` varchar(1) NOT NULL, + `JOB_DATA` blob, + PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_J_REQ_RECOVERY` (`SCHED_NAME`,`REQUESTS_RECOVERY`), + KEY `IDX_QRTZ_J_GRP` (`SCHED_NAME`,`JOB_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -44,36 +44,36 @@ CREATE TABLE `QRTZ_JOB_DETAILS` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_TRIGGERS`; CREATE TABLE `QRTZ_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(200) NOT NULL, - `TRIGGER_GROUP` varchar(200) NOT NULL, - `JOB_NAME` varchar(200) NOT NULL, - `JOB_GROUP` varchar(200) NOT NULL, - `DESCRIPTION` varchar(250) DEFAULT NULL, - `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL, - `PREV_FIRE_TIME` bigint(13) DEFAULT NULL, - `PRIORITY` int(11) DEFAULT NULL, - `TRIGGER_STATE` varchar(16) NOT NULL, - `TRIGGER_TYPE` varchar(8) NOT NULL, - `START_TIME` bigint(13) NOT NULL, - `END_TIME` bigint(13) DEFAULT NULL, - `CALENDAR_NAME` varchar(200) DEFAULT NULL, - `MISFIRE_INSTR` smallint(2) DEFAULT NULL, - `JOB_DATA` blob, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_T_JG` (`SCHED_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_T_C` (`SCHED_NAME`,`CALENDAR_NAME`), - KEY `IDX_QRTZ_T_G` (`SCHED_NAME`,`TRIGGER_GROUP`), - KEY `IDX_QRTZ_T_STATE` (`SCHED_NAME`,`TRIGGER_STATE`), - KEY `IDX_QRTZ_T_N_STATE` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), - KEY `IDX_QRTZ_T_N_G_STATE` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), - KEY `IDX_QRTZ_T_NEXT_FIRE_TIME` (`SCHED_NAME`,`NEXT_FIRE_TIME`), - KEY `IDX_QRTZ_T_NFT_ST` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`), - KEY `IDX_QRTZ_T_NFT_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`), - KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`), - KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), - CONSTRAINT `QRTZ_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `QRTZ_JOB_DETAILS` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `JOB_NAME` varchar(200) NOT NULL, + `JOB_GROUP` varchar(200) NOT NULL, + `DESCRIPTION` varchar(250) DEFAULT NULL, + `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL, + `PREV_FIRE_TIME` bigint(13) DEFAULT NULL, + `PRIORITY` int(11) DEFAULT NULL, + `TRIGGER_STATE` varchar(16) NOT NULL, + `TRIGGER_TYPE` varchar(8) NOT NULL, + `START_TIME` bigint(13) NOT NULL, + `END_TIME` bigint(13) DEFAULT NULL, + `CALENDAR_NAME` varchar(200) DEFAULT NULL, + `MISFIRE_INSTR` smallint(2) DEFAULT NULL, + `JOB_DATA` blob, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + KEY `IDX_QRTZ_T_J` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_T_JG` (`SCHED_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_T_C` (`SCHED_NAME`,`CALENDAR_NAME`), + KEY `IDX_QRTZ_T_G` (`SCHED_NAME`,`TRIGGER_GROUP`), + KEY `IDX_QRTZ_T_STATE` (`SCHED_NAME`,`TRIGGER_STATE`), + KEY `IDX_QRTZ_T_N_STATE` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), + KEY `IDX_QRTZ_T_N_G_STATE` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), + KEY `IDX_QRTZ_T_NEXT_FIRE_TIME` (`SCHED_NAME`,`NEXT_FIRE_TIME`), + KEY `IDX_QRTZ_T_NFT_ST` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`), + KEY `IDX_QRTZ_T_NFT_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`), + KEY `IDX_QRTZ_T_NFT_ST_MISFIRE` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`), + KEY `IDX_QRTZ_T_NFT_ST_MISFIRE_GRP` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`), + CONSTRAINT `QRTZ_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `QRTZ_JOB_DETAILS` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -85,13 +85,13 @@ CREATE TABLE `QRTZ_TRIGGERS` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_BLOB_TRIGGERS`; CREATE TABLE `QRTZ_BLOB_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(200) NOT NULL, - `TRIGGER_GROUP` varchar(200) NOT NULL, - `BLOB_DATA` blob, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `BLOB_DATA` blob, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `QRTZ_BLOB_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -103,10 +103,10 @@ CREATE TABLE `QRTZ_BLOB_TRIGGERS` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_CALENDARS`; CREATE TABLE `QRTZ_CALENDARS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `CALENDAR_NAME` varchar(200) NOT NULL, - `CALENDAR` blob NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`) + `SCHED_NAME` varchar(120) NOT NULL, + `CALENDAR_NAME` varchar(200) NOT NULL, + `CALENDAR` blob NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -118,13 +118,13 @@ CREATE TABLE `QRTZ_CALENDARS` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_CRON_TRIGGERS`; CREATE TABLE `QRTZ_CRON_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(200) NOT NULL, - `TRIGGER_GROUP` varchar(200) NOT NULL, - `CRON_EXPRESSION` varchar(120) NOT NULL, - `TIME_ZONE_ID` varchar(80) DEFAULT NULL, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - CONSTRAINT `QRTZ_CRON_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `CRON_EXPRESSION` varchar(120) NOT NULL, + `TIME_ZONE_ID` varchar(80) DEFAULT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `QRTZ_CRON_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -136,26 +136,26 @@ CREATE TABLE `QRTZ_CRON_TRIGGERS` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_FIRED_TRIGGERS`; CREATE TABLE `QRTZ_FIRED_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `ENTRY_ID` varchar(200) NOT NULL, - `TRIGGER_NAME` varchar(200) NOT NULL, - `TRIGGER_GROUP` varchar(200) NOT NULL, - `INSTANCE_NAME` varchar(200) NOT NULL, - `FIRED_TIME` bigint(13) NOT NULL, - `SCHED_TIME` bigint(13) NOT NULL, - `PRIORITY` int(11) NOT NULL, - `STATE` varchar(16) NOT NULL, - `JOB_NAME` varchar(200) DEFAULT NULL, - `JOB_GROUP` varchar(200) DEFAULT NULL, - `IS_NONCONCURRENT` varchar(1) DEFAULT NULL, - `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL, - PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`), - KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`), - KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`), - KEY `IDX_QRTZ_FT_J_G` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`), - KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`) + `SCHED_NAME` varchar(120) NOT NULL, + `ENTRY_ID` varchar(200) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `INSTANCE_NAME` varchar(200) NOT NULL, + `FIRED_TIME` bigint(13) NOT NULL, + `SCHED_TIME` bigint(13) NOT NULL, + `PRIORITY` int(11) NOT NULL, + `STATE` varchar(16) NOT NULL, + `JOB_NAME` varchar(200) DEFAULT NULL, + `JOB_GROUP` varchar(200) DEFAULT NULL, + `IS_NONCONCURRENT` varchar(1) DEFAULT NULL, + `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL, + PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`), + KEY `IDX_QRTZ_FT_TRIG_INST_NAME` (`SCHED_NAME`,`INSTANCE_NAME`), + KEY `IDX_QRTZ_FT_INST_JOB_REQ_RCVRY` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`), + KEY `IDX_QRTZ_FT_J_G` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_FT_JG` (`SCHED_NAME`,`JOB_GROUP`), + KEY `IDX_QRTZ_FT_T_G` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + KEY `IDX_QRTZ_FT_TG` (`SCHED_NAME`,`TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -167,9 +167,9 @@ CREATE TABLE `QRTZ_FIRED_TRIGGERS` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_LOCKS`; CREATE TABLE `QRTZ_LOCKS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `LOCK_NAME` varchar(40) NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`) + `SCHED_NAME` varchar(120) NOT NULL, + `LOCK_NAME` varchar(40) NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -181,9 +181,9 @@ CREATE TABLE `QRTZ_LOCKS` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_PAUSED_TRIGGER_GRPS`; CREATE TABLE `QRTZ_PAUSED_TRIGGER_GRPS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_GROUP` varchar(200) NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`) + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -195,11 +195,11 @@ CREATE TABLE `QRTZ_PAUSED_TRIGGER_GRPS` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_SCHEDULER_STATE`; CREATE TABLE `QRTZ_SCHEDULER_STATE` ( - `SCHED_NAME` varchar(120) NOT NULL, - `INSTANCE_NAME` varchar(200) NOT NULL, - `LAST_CHECKIN_TIME` bigint(13) NOT NULL, - `CHECKIN_INTERVAL` bigint(13) NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`) + `SCHED_NAME` varchar(120) NOT NULL, + `INSTANCE_NAME` varchar(200) NOT NULL, + `LAST_CHECKIN_TIME` bigint(13) NOT NULL, + `CHECKIN_INTERVAL` bigint(13) NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -211,14 +211,14 @@ CREATE TABLE `QRTZ_SCHEDULER_STATE` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_SIMPLE_TRIGGERS`; CREATE TABLE `QRTZ_SIMPLE_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(200) NOT NULL, - `TRIGGER_GROUP` varchar(200) NOT NULL, - `REPEAT_COUNT` bigint(7) NOT NULL, - `REPEAT_INTERVAL` bigint(12) NOT NULL, - `TIMES_TRIGGERED` bigint(10) NOT NULL, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - CONSTRAINT `QRTZ_SIMPLE_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `REPEAT_COUNT` bigint(7) NOT NULL, + `REPEAT_INTERVAL` bigint(12) NOT NULL, + `TIMES_TRIGGERED` bigint(10) NOT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `QRTZ_SIMPLE_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -230,22 +230,22 @@ CREATE TABLE `QRTZ_SIMPLE_TRIGGERS` ( -- ---------------------------- DROP TABLE IF EXISTS `QRTZ_SIMPROP_TRIGGERS`; CREATE TABLE `QRTZ_SIMPROP_TRIGGERS` ( - `SCHED_NAME` varchar(120) NOT NULL, - `TRIGGER_NAME` varchar(200) NOT NULL, - `TRIGGER_GROUP` varchar(200) NOT NULL, - `STR_PROP_1` varchar(512) DEFAULT NULL, - `STR_PROP_2` varchar(512) DEFAULT NULL, - `STR_PROP_3` varchar(512) DEFAULT NULL, - `INT_PROP_1` int(11) DEFAULT NULL, - `INT_PROP_2` int(11) DEFAULT NULL, - `LONG_PROP_1` bigint(20) DEFAULT NULL, - `LONG_PROP_2` bigint(20) DEFAULT NULL, - `DEC_PROP_1` decimal(13,4) DEFAULT NULL, - `DEC_PROP_2` decimal(13,4) DEFAULT NULL, - `BOOL_PROP_1` varchar(1) DEFAULT NULL, - `BOOL_PROP_2` varchar(1) DEFAULT NULL, - PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), - CONSTRAINT `QRTZ_SIMPROP_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) + `SCHED_NAME` varchar(120) NOT NULL, + `TRIGGER_NAME` varchar(200) NOT NULL, + `TRIGGER_GROUP` varchar(200) NOT NULL, + `STR_PROP_1` varchar(512) DEFAULT NULL, + `STR_PROP_2` varchar(512) DEFAULT NULL, + `STR_PROP_3` varchar(512) DEFAULT NULL, + `INT_PROP_1` int(11) DEFAULT NULL, + `INT_PROP_2` int(11) DEFAULT NULL, + `LONG_PROP_1` bigint(20) DEFAULT NULL, + `LONG_PROP_2` bigint(20) DEFAULT NULL, + `DEC_PROP_1` decimal(13,4) DEFAULT NULL, + `DEC_PROP_2` decimal(13,4) DEFAULT NULL, + `BOOL_PROP_1` varchar(1) DEFAULT NULL, + `BOOL_PROP_2` varchar(1) DEFAULT NULL, + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `QRTZ_SIMPROP_TRIGGERS_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `QRTZ_TRIGGERS` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -257,13 +257,13 @@ CREATE TABLE `QRTZ_SIMPROP_TRIGGERS` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_access_token`; CREATE TABLE `t_ds_access_token` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `user_id` int(11) DEFAULT NULL COMMENT 'user id', - `token` varchar(64) DEFAULT NULL COMMENT 'token', - `expire_time` datetime DEFAULT NULL COMMENT 'end time of token ', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `user_id` int(11) DEFAULT NULL COMMENT 'user id', + `token` varchar(64) DEFAULT NULL COMMENT 'token', + `expire_time` datetime DEFAULT NULL COMMENT 'end time of token ', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -275,23 +275,23 @@ CREATE TABLE `t_ds_access_token` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_alert`; CREATE TABLE `t_ds_alert` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `title` varchar(512) DEFAULT NULL COMMENT 'title', - `sign` char(40) NOT NULL DEFAULT '' COMMENT 'sign=sha1(content)', - `content` text COMMENT 'Message content (can be email, can be SMS. Mail is stored in JSON map, and SMS is string)', - `alert_status` tinyint(4) DEFAULT '0' COMMENT '0:wait running,1:success,2:failed', - `warning_type` tinyint(4) DEFAULT '2' COMMENT '1 process is successfully, 2 process/task is failed', - `log` text COMMENT 'log', - `alertgroup_id` int(11) DEFAULT NULL COMMENT 'alert group id', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - `project_code` bigint(20) DEFAULT NULL COMMENT 'project_code', - `process_definition_code` bigint(20) DEFAULT NULL COMMENT 'process_definition_code', - `process_instance_id` int(11) DEFAULT NULL COMMENT 'process_instance_id', - `alert_type` int(11) DEFAULT NULL COMMENT 'alert_type', - PRIMARY KEY (`id`), - KEY `idx_status` (`alert_status`) USING BTREE, - KEY `idx_sign` (`sign`) USING BTREE + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `title` varchar(512) DEFAULT NULL COMMENT 'title', + `sign` char(40) NOT NULL DEFAULT '' COMMENT 'sign=sha1(content)', + `content` text COMMENT 'Message content (can be email, can be SMS. Mail is stored in JSON map, and SMS is string)', + `alert_status` tinyint(4) DEFAULT '0' COMMENT '0:wait running,1:success,2:failed', + `warning_type` tinyint(4) DEFAULT '2' COMMENT '1 process is successfully, 2 process/task is failed', + `log` text COMMENT 'log', + `alertgroup_id` int(11) DEFAULT NULL COMMENT 'alert group id', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + `project_code` bigint(20) DEFAULT NULL COMMENT 'project_code', + `process_definition_code` bigint(20) DEFAULT NULL COMMENT 'process_definition_code', + `process_instance_id` int(11) DEFAULT NULL COMMENT 'process_instance_id', + `alert_type` int(11) DEFAULT NULL COMMENT 'alert_type', + PRIMARY KEY (`id`), + KEY `idx_status` (`alert_status`) USING BTREE, + KEY `idx_sign` (`sign`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -303,15 +303,15 @@ CREATE TABLE `t_ds_alert` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_alertgroup`; CREATE TABLE `t_ds_alertgroup`( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `alert_instance_ids` varchar (255) DEFAULT NULL COMMENT 'alert instance ids', - `create_user_id` int(11) DEFAULT NULL COMMENT 'create user id', - `group_name` varchar(255) DEFAULT NULL COMMENT 'group name', - `description` varchar(255) DEFAULT NULL, - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY `t_ds_alertgroup_name_un` (`group_name`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `alert_instance_ids` varchar (255) DEFAULT NULL COMMENT 'alert instance ids', + `create_user_id` int(11) DEFAULT NULL COMMENT 'create user id', + `group_name` varchar(255) DEFAULT NULL COMMENT 'group name', + `description` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `t_ds_alertgroup_name_un` (`group_name`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -323,28 +323,28 @@ CREATE TABLE `t_ds_alertgroup`( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_command`; CREATE TABLE `t_ds_command` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `command_type` tinyint(4) DEFAULT NULL COMMENT 'Command type: 0 start workflow, 1 start execution from current node, 2 resume fault-tolerant workflow, 3 resume pause process, 4 start execution from failed node, 5 complement, 6 schedule, 7 rerun, 8 pause, 9 stop, 10 resume waiting thread', - `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code', - `process_definition_version` int(11) DEFAULT '0' COMMENT 'process definition version', - `process_instance_id` int(11) DEFAULT '0' COMMENT 'process instance id', - `command_param` text COMMENT 'json command parameters', - `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'Node dependency type: 0 current node, 1 forward, 2 backward', - `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'Failed policy: 0 end, 1 continue', - `warning_type` tinyint(4) DEFAULT '0' COMMENT 'Alarm type: 0 is not sent, 1 process is sent successfully, 2 process is sent failed, 3 process is sent successfully and all failures are sent', - `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group', - `schedule_time` datetime DEFAULT NULL COMMENT 'schedule time', - `start_time` datetime DEFAULT NULL COMMENT 'start time', - `executor_id` int(11) DEFAULT NULL COMMENT 'executor id', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - `process_instance_priority` int(11) DEFAULT '2' COMMENT 'process instance priority: 0 Highest,1 High,2 Medium,3 Low,4 Lowest', - `worker_group` varchar(255) COMMENT 'worker group', - `tenant_code` varchar(64) DEFAULT 'default' COMMENT 'tenant code', - `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', - `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run', - `test_flag` tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run', - PRIMARY KEY (`id`), - KEY `priority_id_index` (`process_instance_priority`,`id`) USING BTREE + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `command_type` tinyint(4) DEFAULT NULL COMMENT 'Command type: 0 start workflow, 1 start execution from current node, 2 resume fault-tolerant workflow, 3 resume pause process, 4 start execution from failed node, 5 complement, 6 schedule, 7 rerun, 8 pause, 9 stop, 10 resume waiting thread', + `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code', + `process_definition_version` int(11) DEFAULT '0' COMMENT 'process definition version', + `process_instance_id` int(11) DEFAULT '0' COMMENT 'process instance id', + `command_param` text COMMENT 'json command parameters', + `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'Node dependency type: 0 current node, 1 forward, 2 backward', + `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'Failed policy: 0 end, 1 continue', + `warning_type` tinyint(4) DEFAULT '0' COMMENT 'Alarm type: 0 is not sent, 1 process is sent successfully, 2 process is sent failed, 3 process is sent successfully and all failures are sent', + `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group', + `schedule_time` datetime DEFAULT NULL COMMENT 'schedule time', + `start_time` datetime DEFAULT NULL COMMENT 'start time', + `executor_id` int(11) DEFAULT NULL COMMENT 'executor id', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + `process_instance_priority` int(11) DEFAULT '2' COMMENT 'process instance priority: 0 Highest,1 High,2 Medium,3 Low,4 Lowest', + `worker_group` varchar(255) COMMENT 'worker group', + `tenant_code` varchar(64) DEFAULT 'default' COMMENT 'tenant code', + `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', + `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run', + `test_flag` tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run', + PRIMARY KEY (`id`), + KEY `priority_id_index` (`process_instance_priority`,`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -356,16 +356,16 @@ CREATE TABLE `t_ds_command` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_datasource`; CREATE TABLE `t_ds_datasource` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `name` varchar(64) NOT NULL COMMENT 'data source name', - `note` varchar(255) DEFAULT NULL COMMENT 'description', - `type` tinyint(4) NOT NULL COMMENT 'data source type: 0:mysql,1:postgresql,2:hive,3:spark', - `user_id` int(11) NOT NULL COMMENT 'the creator id', - `connection_params` text NOT NULL COMMENT 'json connection params', - `create_time` datetime NOT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY `t_ds_datasource_name_un` (`name`, `type`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `name` varchar(64) NOT NULL COMMENT 'data source name', + `note` varchar(255) DEFAULT NULL COMMENT 'description', + `type` tinyint(4) NOT NULL COMMENT 'data source type: 0:mysql,1:postgresql,2:hive,3:spark', + `user_id` int(11) NOT NULL COMMENT 'the creator id', + `connection_params` text NOT NULL COMMENT 'json connection params', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `t_ds_datasource_name_un` (`name`, `type`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -377,28 +377,28 @@ CREATE TABLE `t_ds_datasource` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_error_command`; CREATE TABLE `t_ds_error_command` ( - `id` int(11) NOT NULL COMMENT 'key', - `command_type` tinyint(4) DEFAULT NULL COMMENT 'command type', - `executor_id` int(11) DEFAULT NULL COMMENT 'executor id', - `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code', - `process_definition_version` int(11) DEFAULT '0' COMMENT 'process definition version', - `process_instance_id` int(11) DEFAULT '0' COMMENT 'process instance id: 0', - `command_param` text COMMENT 'json command parameters', - `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'task depend type', - `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'failure strategy', - `warning_type` tinyint(4) DEFAULT '0' COMMENT 'warning type', - `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group id', - `schedule_time` datetime DEFAULT NULL COMMENT 'scheduler time', - `start_time` datetime DEFAULT NULL COMMENT 'start time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - `process_instance_priority` int(11) DEFAULT '2' COMMENT 'process instance priority, 0 Highest,1 High,2 Medium,3 Low,4 Lowest', - `worker_group` varchar(255) COMMENT 'worker group', - `tenant_code` varchar(64) DEFAULT 'default' COMMENT 'tenant code', - `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', - `message` text COMMENT 'message', - `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag: 0 normal, 1 dry run', - `test_flag` tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run', - PRIMARY KEY (`id`) USING BTREE + `id` int(11) NOT NULL COMMENT 'key', + `command_type` tinyint(4) DEFAULT NULL COMMENT 'command type', + `executor_id` int(11) DEFAULT NULL COMMENT 'executor id', + `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code', + `process_definition_version` int(11) DEFAULT '0' COMMENT 'process definition version', + `process_instance_id` int(11) DEFAULT '0' COMMENT 'process instance id: 0', + `command_param` text COMMENT 'json command parameters', + `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'task depend type', + `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'failure strategy', + `warning_type` tinyint(4) DEFAULT '0' COMMENT 'warning type', + `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group id', + `schedule_time` datetime DEFAULT NULL COMMENT 'scheduler time', + `start_time` datetime DEFAULT NULL COMMENT 'start time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + `process_instance_priority` int(11) DEFAULT '2' COMMENT 'process instance priority, 0 Highest,1 High,2 Medium,3 Low,4 Lowest', + `worker_group` varchar(255) COMMENT 'worker group', + `tenant_code` varchar(64) DEFAULT 'default' COMMENT 'tenant code', + `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', + `message` text COMMENT 'message', + `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag: 0 normal, 1 dry run', + `test_flag` tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run', + PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -410,24 +410,24 @@ CREATE TABLE `t_ds_error_command` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_process_definition`; CREATE TABLE `t_ds_process_definition` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', - `code` bigint(20) NOT NULL COMMENT 'encoding', - `name` varchar(255) DEFAULT NULL COMMENT 'process definition name', - `version` int(11) NOT NULL DEFAULT '1' COMMENT 'process definition version', - `description` text COMMENT 'description', - `project_code` bigint(20) NOT NULL COMMENT 'project code', - `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online', - `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id', - `global_params` text COMMENT 'global parameters', - `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available', - `locations` text COMMENT 'Node location information', - `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id', - `timeout` int(11) DEFAULT '0' COMMENT 'time out, unit: minute', - `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority', - `create_time` datetime NOT NULL COMMENT 'create time', - `update_time` datetime NOT NULL COMMENT 'update time', - PRIMARY KEY (`id`,`code`), - UNIQUE KEY `process_unique` (`name`,`project_code`) USING BTREE + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', + `code` bigint(20) NOT NULL COMMENT 'encoding', + `name` varchar(255) DEFAULT NULL COMMENT 'process definition name', + `version` int(11) NOT NULL DEFAULT '1' COMMENT 'process definition version', + `description` text COMMENT 'description', + `project_code` bigint(20) NOT NULL COMMENT 'project code', + `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online', + `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id', + `global_params` text COMMENT 'global parameters', + `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available', + `locations` text COMMENT 'Node location information', + `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id', + `timeout` int(11) DEFAULT '0' COMMENT 'time out, unit: minute', + `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime NOT NULL COMMENT 'update time', + PRIMARY KEY (`id`,`code`), + UNIQUE KEY `process_unique` (`name`,`project_code`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -439,26 +439,26 @@ CREATE TABLE `t_ds_process_definition` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_process_definition_log`; CREATE TABLE `t_ds_process_definition_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', - `code` bigint(20) NOT NULL COMMENT 'encoding', - `name` varchar(255) DEFAULT NULL COMMENT 'process definition name', - `version` int(11) NOT NULL DEFAULT '1' COMMENT 'process definition version', - `description` text COMMENT 'description', - `project_code` bigint(20) NOT NULL COMMENT 'project code', - `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online', - `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id', - `global_params` text COMMENT 'global parameters', - `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available', - `locations` text COMMENT 'Node location information', - `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id', - `timeout` int(11) DEFAULT '0' COMMENT 'time out,unit: minute', - `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority', - `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', - `update_time` datetime NOT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY `uniq_idx_code_version` (`code`,`version`) USING BTREE + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', + `code` bigint(20) NOT NULL COMMENT 'encoding', + `name` varchar(255) DEFAULT NULL COMMENT 'process definition name', + `version` int(11) NOT NULL DEFAULT '1' COMMENT 'process definition version', + `description` text COMMENT 'description', + `project_code` bigint(20) NOT NULL COMMENT 'project code', + `release_state` tinyint(4) DEFAULT NULL COMMENT 'process definition release state:0:offline,1:online', + `user_id` int(11) DEFAULT NULL COMMENT 'process definition creator id', + `global_params` text COMMENT 'global parameters', + `flag` tinyint(4) DEFAULT NULL COMMENT '0 not available, 1 available', + `locations` text COMMENT 'Node location information', + `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id', + `timeout` int(11) DEFAULT '0' COMMENT 'time out,unit: minute', + `execution_type` tinyint(4) DEFAULT '0' COMMENT 'execution_type 0:parallel,1:serial wait,2:serial discard,3:serial priority', + `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', + `update_time` datetime NOT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `uniq_idx_code_version` (`code`,`version`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -466,35 +466,35 @@ CREATE TABLE `t_ds_process_definition_log` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_task_definition`; CREATE TABLE `t_ds_task_definition` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', - `code` bigint(20) NOT NULL COMMENT 'encoding', - `name` varchar(255) DEFAULT NULL COMMENT 'task definition name', - `version` int(11) NOT NULL DEFAULT '1' COMMENT 'task definition version', - `description` text COMMENT 'description', - `project_code` bigint(20) NOT NULL COMMENT 'project code', - `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id', - `task_type` varchar(50) NOT NULL COMMENT 'task type', - `task_execute_type` int(11) DEFAULT '0' COMMENT 'task execute type: 0-batch, 1-stream', - `task_params` longtext COMMENT 'job custom parameters', - `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available', - `is_cache` tinyint(2) DEFAULT '0' COMMENT '0 not available, 1 available', - `task_priority` tinyint(4) DEFAULT '2' COMMENT 'job priority', - `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker grouping', - `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', - `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries', - `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval', - `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open', - `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` text COMMENT 'resource id, separated by comma', - `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id', - `task_group_priority` tinyint(4) DEFAULT '0' COMMENT 'task group priority', - `cpu_quota` int(11) DEFAULT '-1' NOT NULL COMMENT 'cpuQuota(%): -1:Infinity', - `memory_max` int(11) DEFAULT '-1' NOT NULL COMMENT 'MemoryMax(MB): -1:Infinity', - `create_time` datetime NOT NULL COMMENT 'create time', - `update_time` datetime NOT NULL COMMENT 'update time', - PRIMARY KEY (`id`,`code`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', + `code` bigint(20) NOT NULL COMMENT 'encoding', + `name` varchar(255) DEFAULT NULL COMMENT 'task definition name', + `version` int(11) NOT NULL DEFAULT '1' COMMENT 'task definition version', + `description` text COMMENT 'description', + `project_code` bigint(20) NOT NULL COMMENT 'project code', + `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id', + `task_type` varchar(50) NOT NULL COMMENT 'task type', + `task_execute_type` int(11) DEFAULT '0' COMMENT 'task execute type: 0-batch, 1-stream', + `task_params` longtext COMMENT 'job custom parameters', + `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available', + `is_cache` tinyint(2) DEFAULT '0' COMMENT '0 not available, 1 available', + `task_priority` tinyint(4) DEFAULT '2' COMMENT 'job priority', + `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker grouping', + `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', + `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries', + `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval', + `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open', + `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` text COMMENT 'resource id, separated by comma', + `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id', + `task_group_priority` tinyint(4) DEFAULT '0' COMMENT 'task group priority', + `cpu_quota` int(11) DEFAULT '-1' NOT NULL COMMENT 'cpuQuota(%): -1:Infinity', + `memory_max` int(11) DEFAULT '-1' NOT NULL COMMENT 'MemoryMax(MB): -1:Infinity', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime NOT NULL COMMENT 'update time', + PRIMARY KEY (`id`,`code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -502,39 +502,39 @@ CREATE TABLE `t_ds_task_definition` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_task_definition_log`; CREATE TABLE `t_ds_task_definition_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', - `code` bigint(20) NOT NULL COMMENT 'encoding', - `name` varchar(255) DEFAULT NULL COMMENT 'task definition name', - `version` int(11) NOT NULL DEFAULT '1' COMMENT 'task definition version', - `description` text COMMENT 'description', - `project_code` bigint(20) NOT NULL COMMENT 'project code', - `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id', - `task_type` varchar(50) NOT NULL COMMENT 'task type', - `task_execute_type` int(11) DEFAULT '0' COMMENT 'task execute type: 0-batch, 1-stream', - `task_params` longtext COMMENT 'job custom parameters', - `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available', - `is_cache` tinyint(2) DEFAULT '0' COMMENT '0 not available, 1 available', - `task_priority` tinyint(4) DEFAULT '2' COMMENT 'job priority', - `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker grouping', - `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', - `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries', - `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval', - `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open', - `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` text DEFAULT NULL COMMENT 'resource id, separated by comma', - `operator` int(11) DEFAULT NULL COMMENT 'operator user id', - `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id', - `task_group_priority` tinyint(4) DEFAULT 0 COMMENT 'task group priority', - `operate_time` datetime DEFAULT NULL COMMENT 'operate time', - `cpu_quota` int(11) DEFAULT '-1' NOT NULL COMMENT 'cpuQuota(%): -1:Infinity', - `memory_max` int(11) DEFAULT '-1' NOT NULL COMMENT 'MemoryMax(MB): -1:Infinity', - `create_time` datetime NOT NULL COMMENT 'create time', - `update_time` datetime NOT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - KEY `idx_code_version` (`code`,`version`), - KEY `idx_project_code` (`project_code`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', + `code` bigint(20) NOT NULL COMMENT 'encoding', + `name` varchar(255) DEFAULT NULL COMMENT 'task definition name', + `version` int(11) NOT NULL DEFAULT '1' COMMENT 'task definition version', + `description` text COMMENT 'description', + `project_code` bigint(20) NOT NULL COMMENT 'project code', + `user_id` int(11) DEFAULT NULL COMMENT 'task definition creator id', + `task_type` varchar(50) NOT NULL COMMENT 'task type', + `task_execute_type` int(11) DEFAULT '0' COMMENT 'task execute type: 0-batch, 1-stream', + `task_params` longtext COMMENT 'job custom parameters', + `flag` tinyint(2) DEFAULT NULL COMMENT '0 not available, 1 available', + `is_cache` tinyint(2) DEFAULT '0' COMMENT '0 not available, 1 available', + `task_priority` tinyint(4) DEFAULT '2' COMMENT 'job priority', + `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker grouping', + `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', + `fail_retry_times` int(11) DEFAULT NULL COMMENT 'number of failed retries', + `fail_retry_interval` int(11) DEFAULT NULL COMMENT 'failed retry interval', + `timeout_flag` tinyint(2) DEFAULT '0' COMMENT 'timeout flag:0 close, 1 open', + `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` text DEFAULT NULL COMMENT 'resource id, separated by comma', + `operator` int(11) DEFAULT NULL COMMENT 'operator user id', + `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id', + `task_group_priority` tinyint(4) DEFAULT 0 COMMENT 'task group priority', + `operate_time` datetime DEFAULT NULL COMMENT 'operate time', + `cpu_quota` int(11) DEFAULT '-1' NOT NULL COMMENT 'cpuQuota(%): -1:Infinity', + `memory_max` int(11) DEFAULT '-1' NOT NULL COMMENT 'MemoryMax(MB): -1:Infinity', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime NOT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + KEY `idx_code_version` (`code`,`version`), + KEY `idx_project_code` (`project_code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -542,23 +542,23 @@ CREATE TABLE `t_ds_task_definition_log` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_process_task_relation`; CREATE TABLE `t_ds_process_task_relation` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', - `name` varchar(255) DEFAULT NULL COMMENT 'relation name', - `project_code` bigint(20) NOT NULL COMMENT 'project code', - `process_definition_code` bigint(20) NOT NULL COMMENT 'process code', - `process_definition_version` int(11) NOT NULL COMMENT 'process version', - `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code', - `pre_task_version` int(11) NOT NULL COMMENT 'pre task version', - `post_task_code` bigint(20) NOT NULL COMMENT 'post task code', - `post_task_version` int(11) NOT NULL COMMENT 'post task version', - `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay', - `condition_params` text COMMENT 'condition params(json)', - `create_time` datetime NOT NULL COMMENT 'create time', - `update_time` datetime NOT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - KEY `idx_code` (`project_code`,`process_definition_code`), - KEY `idx_pre_task_code_version` (`pre_task_code`,`pre_task_version`), - KEY `idx_post_task_code_version` (`post_task_code`,`post_task_version`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', + `name` varchar(255) DEFAULT NULL COMMENT 'relation name', + `project_code` bigint(20) NOT NULL COMMENT 'project code', + `process_definition_code` bigint(20) NOT NULL COMMENT 'process code', + `process_definition_version` int(11) NOT NULL COMMENT 'process version', + `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code', + `pre_task_version` int(11) NOT NULL COMMENT 'pre task version', + `post_task_code` bigint(20) NOT NULL COMMENT 'post task code', + `post_task_version` int(11) NOT NULL COMMENT 'post task version', + `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay', + `condition_params` text COMMENT 'condition params(json)', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime NOT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + KEY `idx_code` (`project_code`,`process_definition_code`), + KEY `idx_pre_task_code_version` (`pre_task_code`,`pre_task_version`), + KEY `idx_post_task_code_version` (`post_task_code`,`post_task_version`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -566,23 +566,23 @@ CREATE TABLE `t_ds_process_task_relation` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_process_task_relation_log`; CREATE TABLE `t_ds_process_task_relation_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', - `name` varchar(255) DEFAULT NULL COMMENT 'relation name', - `project_code` bigint(20) NOT NULL COMMENT 'project code', - `process_definition_code` bigint(20) NOT NULL COMMENT 'process code', - `process_definition_version` int(11) NOT NULL COMMENT 'process version', - `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code', - `pre_task_version` int(11) NOT NULL COMMENT 'pre task version', - `post_task_code` bigint(20) NOT NULL COMMENT 'post task code', - `post_task_version` int(11) NOT NULL COMMENT 'post task version', - `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay', - `condition_params` text COMMENT 'condition params(json)', - `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', - `update_time` datetime NOT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - KEY `idx_process_code_version` (`process_definition_code`,`process_definition_version`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'self-increasing id', + `name` varchar(255) DEFAULT NULL COMMENT 'relation name', + `project_code` bigint(20) NOT NULL COMMENT 'project code', + `process_definition_code` bigint(20) NOT NULL COMMENT 'process code', + `process_definition_version` int(11) NOT NULL COMMENT 'process version', + `pre_task_code` bigint(20) NOT NULL COMMENT 'pre task code', + `pre_task_version` int(11) NOT NULL COMMENT 'pre task version', + `post_task_code` bigint(20) NOT NULL COMMENT 'post task code', + `post_task_version` int(11) NOT NULL COMMENT 'post task version', + `condition_type` tinyint(2) DEFAULT NULL COMMENT 'condition type : 0 none, 1 judge 2 delay', + `condition_params` text COMMENT 'condition params(json)', + `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', + `update_time` datetime NOT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + KEY `idx_process_code_version` (`process_definition_code`,`process_definition_version`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -590,47 +590,47 @@ CREATE TABLE `t_ds_process_task_relation_log` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_process_instance`; CREATE TABLE `t_ds_process_instance` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `name` varchar(255) DEFAULT NULL COMMENT 'process instance name', - `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code', - `process_definition_version` int(11) NOT NULL DEFAULT '1' COMMENT 'process definition version', - `project_code` bigint(20) DEFAULT NULL COMMENT 'project code', - `state` tinyint(4) DEFAULT NULL COMMENT 'process instance Status: 0 commit succeeded, 1 running, 2 prepare to pause, 3 pause, 4 prepare to stop, 5 stop, 6 fail, 7 succeed, 8 need fault tolerance, 9 kill, 10 wait for thread, 11 wait for dependency to complete', - `state_history` text DEFAULT NULL COMMENT 'state history desc', - `recovery` tinyint(4) DEFAULT NULL COMMENT 'process instance failover flag:0:normal,1:failover instance', - `start_time` datetime DEFAULT NULL COMMENT 'process instance start time', - `end_time` datetime DEFAULT NULL COMMENT 'process instance end time', - `run_times` int(11) DEFAULT NULL COMMENT 'process instance run times', - `host` varchar(135) DEFAULT NULL COMMENT 'process instance host', - `command_type` tinyint(4) DEFAULT NULL COMMENT 'command type', - `command_param` text COMMENT 'json command parameters', - `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'task depend type. 0: only current node,1:before the node,2:later nodes', - `max_try_times` tinyint(4) DEFAULT '0' COMMENT 'max try times', - `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'failure strategy. 0:end the process when node failed,1:continue running the other nodes when node failed', - `warning_type` tinyint(4) DEFAULT '0' COMMENT 'warning type. 0:no warning,1:warning if process success,2:warning if process failed,3:warning if success', - `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group id', - `schedule_time` datetime DEFAULT NULL COMMENT 'schedule time', - `command_start_time` datetime DEFAULT NULL COMMENT 'command start time', - `global_params` text COMMENT 'global parameters', - `flag` tinyint(4) DEFAULT '1' COMMENT 'flag', - `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `is_sub_process` int(11) DEFAULT '0' COMMENT 'flag, whether the process is sub process', - `executor_id` int(11) NOT NULL COMMENT 'executor id', - `executor_name` varchar(64) DEFAULT NULL COMMENT 'execute user name', - `history_cmd` text COMMENT 'history commands of process instance operation', - `process_instance_priority` int(11) DEFAULT '2' COMMENT 'process instance priority. 0 Highest,1 High,2 Medium,3 Low,4 Lowest', - `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker group id', - `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', - `timeout` int(11) DEFAULT '0' COMMENT 'time out', - `tenant_code` varchar(64) DEFAULT 'default' COMMENT 'tenant code', - `var_pool` longtext COMMENT 'var_pool', - `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run', - `next_process_instance_id` int(11) DEFAULT '0' COMMENT 'serial queue next processInstanceId', - `restart_time` datetime DEFAULT NULL COMMENT 'process instance restart time', - `test_flag` tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run', - PRIMARY KEY (`id`), - KEY `process_instance_index` (`process_definition_code`,`id`) USING BTREE, - KEY `start_time_index` (`start_time`,`end_time`) USING BTREE + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `name` varchar(255) DEFAULT NULL COMMENT 'process instance name', + `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code', + `process_definition_version` int(11) NOT NULL DEFAULT '1' COMMENT 'process definition version', + `project_code` bigint(20) DEFAULT NULL COMMENT 'project code', + `state` tinyint(4) DEFAULT NULL COMMENT 'process instance Status: 0 commit succeeded, 1 running, 2 prepare to pause, 3 pause, 4 prepare to stop, 5 stop, 6 fail, 7 succeed, 8 need fault tolerance, 9 kill, 10 wait for thread, 11 wait for dependency to complete', + `state_history` text DEFAULT NULL COMMENT 'state history desc', + `recovery` tinyint(4) DEFAULT NULL COMMENT 'process instance failover flag:0:normal,1:failover instance', + `start_time` datetime DEFAULT NULL COMMENT 'process instance start time', + `end_time` datetime DEFAULT NULL COMMENT 'process instance end time', + `run_times` int(11) DEFAULT NULL COMMENT 'process instance run times', + `host` varchar(135) DEFAULT NULL COMMENT 'process instance host', + `command_type` tinyint(4) DEFAULT NULL COMMENT 'command type', + `command_param` text COMMENT 'json command parameters', + `task_depend_type` tinyint(4) DEFAULT NULL COMMENT 'task depend type. 0: only current node,1:before the node,2:later nodes', + `max_try_times` tinyint(4) DEFAULT '0' COMMENT 'max try times', + `failure_strategy` tinyint(4) DEFAULT '0' COMMENT 'failure strategy. 0:end the process when node failed,1:continue running the other nodes when node failed', + `warning_type` tinyint(4) DEFAULT '0' COMMENT 'warning type. 0:no warning,1:warning if process success,2:warning if process failed,3:warning if success', + `warning_group_id` int(11) DEFAULT NULL COMMENT 'warning group id', + `schedule_time` datetime DEFAULT NULL COMMENT 'schedule time', + `command_start_time` datetime DEFAULT NULL COMMENT 'command start time', + `global_params` text COMMENT 'global parameters', + `flag` tinyint(4) DEFAULT '1' COMMENT 'flag', + `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `is_sub_process` int(11) DEFAULT '0' COMMENT 'flag, whether the process is sub process', + `executor_id` int(11) NOT NULL COMMENT 'executor id', + `executor_name` varchar(64) DEFAULT NULL COMMENT 'execute user name', + `history_cmd` text COMMENT 'history commands of process instance operation', + `process_instance_priority` int(11) DEFAULT '2' COMMENT 'process instance priority. 0 Highest,1 High,2 Medium,3 Low,4 Lowest', + `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker group id', + `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', + `timeout` int(11) DEFAULT '0' COMMENT 'time out', + `tenant_code` varchar(64) DEFAULT 'default' COMMENT 'tenant code', + `var_pool` longtext COMMENT 'var_pool', + `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag:0 normal, 1 dry run', + `next_process_instance_id` int(11) DEFAULT '0' COMMENT 'serial queue next processInstanceId', + `restart_time` datetime DEFAULT NULL COMMENT 'process instance restart time', + `test_flag` tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run', + PRIMARY KEY (`id`), + KEY `process_instance_index` (`process_definition_code`,`id`) USING BTREE, + KEY `start_time_index` (`start_time`,`end_time`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -642,18 +642,18 @@ CREATE TABLE `t_ds_process_instance` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_project`; CREATE TABLE `t_ds_project` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `name` varchar(255) DEFAULT NULL COMMENT 'project name', - `code` bigint(20) NOT NULL COMMENT 'encoding', - `description` varchar(255) DEFAULT NULL, - `user_id` int(11) DEFAULT NULL COMMENT 'creator id', - `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available', - `create_time` datetime NOT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - KEY `user_id_index` (`user_id`) USING BTREE, - UNIQUE KEY `unique_name`(`name`), - UNIQUE KEY `unique_code`(`code`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `name` varchar(255) DEFAULT NULL COMMENT 'project name', + `code` bigint(20) NOT NULL COMMENT 'encoding', + `description` varchar(255) DEFAULT NULL, + `user_id` int(11) DEFAULT NULL COMMENT 'creator id', + `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + KEY `user_id_index` (`user_id`) USING BTREE, + UNIQUE KEY `unique_name`(`name`), + UNIQUE KEY `unique_code`(`code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -665,19 +665,19 @@ CREATE TABLE `t_ds_project` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_project_parameter`; CREATE TABLE `t_ds_project_parameter` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `param_name` varchar(255) NOT NULL COMMENT 'project parameter name', - `param_value` text NOT NULL COMMENT 'project parameter value', - `param_data_type` varchar(50) DEFAULT 'VARCHAR' COMMENT 'project parameter data type', - `code` bigint(20) NOT NULL COMMENT 'encoding', - `project_code` bigint(20) NOT NULL COMMENT 'project code', - `user_id` int(11) DEFAULT NULL COMMENT 'creator id', - `operator` int(11) DEFAULT NULL COMMENT 'operator user id', - `create_time` datetime NOT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY `unique_project_parameter_name`(`project_code`, `param_name`), - UNIQUE KEY `unique_project_parameter_code`(`code`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `param_name` varchar(255) NOT NULL COMMENT 'project parameter name', + `param_value` text NOT NULL COMMENT 'project parameter value', + `param_data_type` varchar(50) DEFAULT 'VARCHAR' COMMENT 'project parameter data type', + `code` bigint(20) NOT NULL COMMENT 'encoding', + `project_code` bigint(20) NOT NULL COMMENT 'project code', + `user_id` int(11) DEFAULT NULL COMMENT 'creator id', + `operator` int(11) DEFAULT NULL COMMENT 'operator user id', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `unique_project_parameter_name`(`project_code`, `param_name`), + UNIQUE KEY `unique_project_parameter_code`(`code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -689,17 +689,17 @@ CREATE TABLE `t_ds_project_parameter` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_project_preference`; CREATE TABLE `t_ds_project_preference` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `code` bigint(20) NOT NULL COMMENT 'encoding', - `project_code` bigint(20) NOT NULL COMMENT 'project code', - `preferences` varchar(512) NOT NULL COMMENT 'project preferences', - `user_id` int(11) DEFAULT NULL COMMENT 'creator id', - `state` int(11) DEFAULT '1' comment '1 means enabled, 0 means disabled', - `create_time` datetime NOT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY `unique_project_preference_project_code`(`project_code`), - UNIQUE KEY `unique_project_preference_code`(`code`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `code` bigint(20) NOT NULL COMMENT 'encoding', + `project_code` bigint(20) NOT NULL COMMENT 'project code', + `preferences` varchar(512) NOT NULL COMMENT 'project preferences', + `user_id` int(11) DEFAULT NULL COMMENT 'creator id', + `state` int(11) DEFAULT '1' comment '1 means enabled, 0 means disabled', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `unique_project_preference_project_code`(`project_code`), + UNIQUE KEY `unique_project_preference_code`(`code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -711,13 +711,13 @@ CREATE TABLE `t_ds_project_preference` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_queue`; CREATE TABLE `t_ds_queue` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `queue_name` varchar(64) DEFAULT NULL COMMENT 'queue name', - `queue` varchar(64) DEFAULT NULL COMMENT 'yarn queue name', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY `unique_queue_name`(`queue_name`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `queue_name` varchar(64) DEFAULT NULL COMMENT 'queue name', + `queue` varchar(64) DEFAULT NULL COMMENT 'yarn queue name', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `unique_queue_name`(`queue_name`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -730,13 +730,13 @@ INSERT IGNORE INTO `t_ds_queue` VALUES ('1', 'default', 'default', null, null); -- ---------------------------- DROP TABLE IF EXISTS `t_ds_relation_datasource_user`; CREATE TABLE `t_ds_relation_datasource_user` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `user_id` int(11) NOT NULL COMMENT 'user id', - `datasource_id` int(11) DEFAULT NULL COMMENT 'data source id', - `perm` int(11) DEFAULT '1' COMMENT 'limits of authority', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `user_id` int(11) NOT NULL COMMENT 'user id', + `datasource_id` int(11) DEFAULT NULL COMMENT 'data source id', + `perm` int(11) DEFAULT '1' COMMENT 'limits of authority', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -748,13 +748,13 @@ CREATE TABLE `t_ds_relation_datasource_user` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_relation_process_instance`; CREATE TABLE `t_ds_relation_process_instance` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `parent_process_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id', - `parent_task_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id', - `process_instance_id` int(11) DEFAULT NULL COMMENT 'child process instance id', - PRIMARY KEY (`id`), - KEY `idx_parent_process_task` (`parent_process_instance_id`,`parent_task_instance_id`) , - KEY `idx_process_instance_id` (`process_instance_id`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `parent_process_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id', + `parent_task_instance_id` int(11) DEFAULT NULL COMMENT 'parent process instance id', + `process_instance_id` int(11) DEFAULT NULL COMMENT 'child process instance id', + PRIMARY KEY (`id`), + KEY `idx_parent_process_task` (`parent_process_instance_id`,`parent_task_instance_id`) , + KEY `idx_process_instance_id` (`process_instance_id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -766,14 +766,14 @@ CREATE TABLE `t_ds_relation_process_instance` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_relation_project_user`; CREATE TABLE `t_ds_relation_project_user` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `user_id` int(11) NOT NULL COMMENT 'user id', - `project_id` int(11) DEFAULT NULL COMMENT 'project id', - `perm` int(11) DEFAULT '1' COMMENT 'limits of authority', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY uniq_uid_pid(user_id,project_id) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `user_id` int(11) NOT NULL COMMENT 'user id', + `project_id` int(11) DEFAULT NULL COMMENT 'project id', + `perm` int(11) DEFAULT '1' COMMENT 'limits of authority', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY uniq_uid_pid(user_id,project_id) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -786,38 +786,82 @@ CREATE TABLE `t_ds_relation_project_user` ( -- Deprecated DROP TABLE IF EXISTS `t_ds_relation_resources_user`; CREATE TABLE `t_ds_relation_resources_user` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL COMMENT 'user id', - `resources_id` int(11) DEFAULT NULL COMMENT 'resource id', - `perm` int(11) DEFAULT '1' COMMENT 'limits of authority', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL COMMENT 'user id', + `resources_id` int(11) DEFAULT NULL COMMENT 'resource id', + `perm` int(11) DEFAULT '1' COMMENT 'limits of authority', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; +-- ---------------------------- +-- Records of t_ds_relation_resources_user +-- ---------------------------- + +-- ---------------------------- +-- Table structure for t_ds_relation_udfs_user +-- ---------------------------- +DROP TABLE IF EXISTS `t_ds_relation_udfs_user`; +CREATE TABLE `t_ds_relation_udfs_user` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `user_id` int(11) NOT NULL COMMENT 'userid', + `udf_id` int(11) DEFAULT NULL COMMENT 'udf id', + `perm` int(11) DEFAULT '1' COMMENT 'limits of authority', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; + +-- ---------------------------- +-- Table structure for t_ds_resources +-- ---------------------------- +-- Deprecated +DROP TABLE IF EXISTS `t_ds_resources`; +CREATE TABLE `t_ds_resources` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `alias` varchar(64) DEFAULT NULL COMMENT 'alias', + `file_name` varchar(64) DEFAULT NULL COMMENT 'file name', + `description` varchar(255) DEFAULT NULL, + `user_id` int(11) DEFAULT NULL COMMENT 'user id', + `type` tinyint(4) DEFAULT NULL COMMENT 'resource type,0:FILE,1:UDF', + `size` bigint(20) DEFAULT NULL COMMENT 'resource size', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + `pid` int(11) DEFAULT NULL, + `full_name` varchar(128) DEFAULT NULL, + `is_directory` tinyint(4) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `t_ds_resources_un` (`full_name`,`type`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; + +-- ---------------------------- +-- Records of t_ds_resources +-- ---------------------------- + -- ---------------------------- -- Table structure for t_ds_schedules -- ---------------------------- DROP TABLE IF EXISTS `t_ds_schedules`; CREATE TABLE `t_ds_schedules` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code', - `start_time` datetime NOT NULL COMMENT 'start time', - `end_time` datetime NOT NULL COMMENT 'end time', - `timezone_id` varchar(40) DEFAULT NULL COMMENT 'schedule timezone id', - `crontab` varchar(255) NOT NULL COMMENT 'crontab description', - `failure_strategy` tinyint(4) NOT NULL COMMENT 'failure strategy. 0:end,1:continue', - `user_id` int(11) NOT NULL COMMENT 'user id', - `release_state` tinyint(4) NOT NULL COMMENT 'release state. 0:offline,1:online ', - `warning_type` tinyint(4) NOT NULL COMMENT 'Alarm type: 0 is not sent, 1 process is sent successfully, 2 process is sent failed, 3 process is sent successfully and all failures are sent', - `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id', - `process_instance_priority` int(11) DEFAULT '2' COMMENT 'process instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest', - `worker_group` varchar(255) DEFAULT '' COMMENT 'worker group id', - `tenant_code` varchar(64) DEFAULT 'default' COMMENT 'tenant code', - `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', - `create_time` datetime NOT NULL COMMENT 'create time', - `update_time` datetime NOT NULL COMMENT 'update time', - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `process_definition_code` bigint(20) NOT NULL COMMENT 'process definition code', + `start_time` datetime NOT NULL COMMENT 'start time', + `end_time` datetime NOT NULL COMMENT 'end time', + `timezone_id` varchar(40) DEFAULT NULL COMMENT 'schedule timezone id', + `crontab` varchar(255) NOT NULL COMMENT 'crontab description', + `failure_strategy` tinyint(4) NOT NULL COMMENT 'failure strategy. 0:end,1:continue', + `user_id` int(11) NOT NULL COMMENT 'user id', + `release_state` tinyint(4) NOT NULL COMMENT 'release state. 0:offline,1:online ', + `warning_type` tinyint(4) NOT NULL COMMENT 'Alarm type: 0 is not sent, 1 process is sent successfully, 2 process is sent failed, 3 process is sent successfully and all failures are sent', + `warning_group_id` int(11) DEFAULT NULL COMMENT 'alert group id', + `process_instance_priority` int(11) DEFAULT '2' COMMENT 'process instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest', + `worker_group` varchar(255) DEFAULT '' COMMENT 'worker group id', + `tenant_code` varchar(64) DEFAULT 'default' COMMENT 'tenant code', + `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime NOT NULL COMMENT 'update time', + PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -829,11 +873,11 @@ CREATE TABLE `t_ds_schedules` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_session`; CREATE TABLE `t_ds_session` ( - `id` varchar(64) NOT NULL COMMENT 'key', - `user_id` int(11) DEFAULT NULL COMMENT 'user id', - `ip` varchar(45) DEFAULT NULL COMMENT 'ip', - `last_login_time` datetime DEFAULT NULL COMMENT 'last login time', - PRIMARY KEY (`id`) + `id` varchar(64) NOT NULL COMMENT 'key', + `user_id` int(11) DEFAULT NULL COMMENT 'user id', + `ip` varchar(45) DEFAULT NULL COMMENT 'ip', + `last_login_time` datetime DEFAULT NULL COMMENT 'last login time', + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -845,50 +889,50 @@ CREATE TABLE `t_ds_session` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_task_instance`; CREATE TABLE `t_ds_task_instance` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `name` varchar(255) DEFAULT NULL COMMENT 'task name', - `task_type` varchar(50) NOT NULL COMMENT 'task type', - `task_execute_type` int(11) DEFAULT '0' COMMENT 'task execute type: 0-batch, 1-stream', - `task_code` bigint(20) NOT NULL COMMENT 'task definition code', - `task_definition_version` int(11) NOT NULL DEFAULT '1' COMMENT 'task definition version', - `process_instance_id` int(11) DEFAULT NULL COMMENT 'process instance id', - `process_instance_name` varchar(255) DEFAULT NULL COMMENT 'process instance name', - `project_code` bigint(20) DEFAULT NULL COMMENT 'project code', - `state` tinyint(4) DEFAULT NULL COMMENT 'Status: 0 commit succeeded, 1 running, 2 prepare to pause, 3 pause, 4 prepare to stop, 5 stop, 6 fail, 7 succeed, 8 need fault tolerance, 9 kill, 10 wait for thread, 11 wait for dependency to complete', - `submit_time` datetime DEFAULT NULL COMMENT 'task submit time', - `start_time` datetime DEFAULT NULL COMMENT 'task start time', - `end_time` datetime DEFAULT NULL COMMENT 'task end time', - `host` varchar(135) DEFAULT NULL COMMENT 'host of task running on', - `execute_path` varchar(200) DEFAULT NULL COMMENT 'task execute path in the host', - `log_path` longtext DEFAULT NULL COMMENT 'task log path', - `alert_flag` tinyint(4) DEFAULT NULL COMMENT 'whether alert', - `retry_times` int(4) DEFAULT '0' COMMENT 'task retry times', - `pid` int(4) DEFAULT NULL COMMENT 'pid of task', - `app_link` text COMMENT 'yarn app id', - `task_params` longtext COMMENT 'job custom parameters', - `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available', - `is_cache` tinyint(2) DEFAULT '0' COMMENT '0 not available, 1 available', - `cache_key` varchar(200) DEFAULT NULL COMMENT 'cache_key', - `retry_interval` int(4) DEFAULT NULL COMMENT 'retry interval when task failed ', - `max_retry_times` int(2) DEFAULT NULL COMMENT 'max retry times', - `task_instance_priority` int(11) DEFAULT NULL COMMENT 'task instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest', - `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker group id', - `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', - `environment_config` text COMMENT 'this config contains many environment variables config', - `executor_id` int(11) DEFAULT NULL, - `executor_name` varchar(64) DEFAULT NULL, - `first_submit_time` datetime DEFAULT NULL COMMENT 'task first submit time', - `delay_time` int(4) DEFAULT '0' COMMENT 'task delay execution time', - `var_pool` longtext COMMENT 'var_pool', - `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id', - `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag: 0 normal, 1 dry run', - `cpu_quota` int(11) DEFAULT '-1' NOT NULL COMMENT 'cpuQuota(%): -1:Infinity', - `memory_max` int(11) DEFAULT '-1' NOT NULL COMMENT 'MemoryMax(MB): -1:Infinity', - `test_flag` tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run', - PRIMARY KEY (`id`), - KEY `process_instance_id` (`process_instance_id`) USING BTREE, - KEY `idx_code_version` (`task_code`, `task_definition_version`) USING BTREE, - KEY `idx_cache_key` (`cache_key`) USING BTREE + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `name` varchar(255) DEFAULT NULL COMMENT 'task name', + `task_type` varchar(50) NOT NULL COMMENT 'task type', + `task_execute_type` int(11) DEFAULT '0' COMMENT 'task execute type: 0-batch, 1-stream', + `task_code` bigint(20) NOT NULL COMMENT 'task definition code', + `task_definition_version` int(11) NOT NULL DEFAULT '1' COMMENT 'task definition version', + `process_instance_id` int(11) DEFAULT NULL COMMENT 'process instance id', + `process_instance_name` varchar(255) DEFAULT NULL COMMENT 'process instance name', + `project_code` bigint(20) DEFAULT NULL COMMENT 'project code', + `state` tinyint(4) DEFAULT NULL COMMENT 'Status: 0 commit succeeded, 1 running, 2 prepare to pause, 3 pause, 4 prepare to stop, 5 stop, 6 fail, 7 succeed, 8 need fault tolerance, 9 kill, 10 wait for thread, 11 wait for dependency to complete', + `submit_time` datetime DEFAULT NULL COMMENT 'task submit time', + `start_time` datetime DEFAULT NULL COMMENT 'task start time', + `end_time` datetime DEFAULT NULL COMMENT 'task end time', + `host` varchar(135) DEFAULT NULL COMMENT 'host of task running on', + `execute_path` varchar(200) DEFAULT NULL COMMENT 'task execute path in the host', + `log_path` longtext DEFAULT NULL COMMENT 'task log path', + `alert_flag` tinyint(4) DEFAULT NULL COMMENT 'whether alert', + `retry_times` int(4) DEFAULT '0' COMMENT 'task retry times', + `pid` int(4) DEFAULT NULL COMMENT 'pid of task', + `app_link` text COMMENT 'yarn app id', + `task_params` longtext COMMENT 'job custom parameters', + `flag` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available', + `is_cache` tinyint(2) DEFAULT '0' COMMENT '0 not available, 1 available', + `cache_key` varchar(200) DEFAULT NULL COMMENT 'cache_key', + `retry_interval` int(4) DEFAULT NULL COMMENT 'retry interval when task failed ', + `max_retry_times` int(2) DEFAULT NULL COMMENT 'max retry times', + `task_instance_priority` int(11) DEFAULT NULL COMMENT 'task instance priority:0 Highest,1 High,2 Medium,3 Low,4 Lowest', + `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker group id', + `environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code', + `environment_config` text COMMENT 'this config contains many environment variables config', + `executor_id` int(11) DEFAULT NULL, + `executor_name` varchar(64) DEFAULT NULL, + `first_submit_time` datetime DEFAULT NULL COMMENT 'task first submit time', + `delay_time` int(4) DEFAULT '0' COMMENT 'task delay execution time', + `var_pool` longtext COMMENT 'var_pool', + `task_group_id` int(11) DEFAULT NULL COMMENT 'task group id', + `dry_run` tinyint(4) DEFAULT '0' COMMENT 'dry run flag: 0 normal, 1 dry run', + `cpu_quota` int(11) DEFAULT '-1' NOT NULL COMMENT 'cpuQuota(%): -1:Infinity', + `memory_max` int(11) DEFAULT '-1' NOT NULL COMMENT 'MemoryMax(MB): -1:Infinity', + `test_flag` tinyint(4) DEFAULT null COMMENT 'test flag:0 normal, 1 test run', + PRIMARY KEY (`id`), + KEY `process_instance_id` (`process_instance_id`) USING BTREE, + KEY `idx_code_version` (`task_code`, `task_definition_version`) USING BTREE, + KEY `idx_cache_key` (`cache_key`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -900,14 +944,14 @@ CREATE TABLE `t_ds_task_instance` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_tenant`; CREATE TABLE `t_ds_tenant` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `tenant_code` varchar(64) DEFAULT NULL COMMENT 'tenant code', - `description` varchar(255) DEFAULT NULL, - `queue_id` int(11) DEFAULT NULL COMMENT 'queue id', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY `unique_tenant_code`(`tenant_code`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `tenant_code` varchar(64) DEFAULT NULL COMMENT 'tenant code', + `description` varchar(255) DEFAULT NULL, + `queue_id` int(11) DEFAULT NULL COMMENT 'queue id', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `unique_tenant_code`(`tenant_code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -917,25 +961,50 @@ CREATE TABLE `t_ds_tenant` ( INSERT IGNORE INTO `t_ds_tenant` VALUES ('-1', 'default', 'default tenant', '1', current_timestamp, current_timestamp); +-- ---------------------------- +-- Table structure for t_ds_udfs +-- ---------------------------- +DROP TABLE IF EXISTS `t_ds_udfs`; +CREATE TABLE `t_ds_udfs` ( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `user_id` int(11) NOT NULL COMMENT 'user id', + `func_name` varchar(255) NOT NULL COMMENT 'UDF function name', + `class_name` varchar(255) NOT NULL COMMENT 'class of udf', + `type` tinyint(4) NOT NULL COMMENT 'Udf function type', + `arg_types` varchar(255) DEFAULT NULL COMMENT 'arguments types', + `database` varchar(255) DEFAULT NULL COMMENT 'data base', + `description` varchar(255) DEFAULT NULL, + `resource_id` int(11) NOT NULL COMMENT 'resource id', + `resource_name` varchar(255) NOT NULL COMMENT 'resource name', + `create_time` datetime NOT NULL COMMENT 'create time', + `update_time` datetime NOT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `unique_func_name`(`func_name`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; + +-- ---------------------------- +-- Records of t_ds_udfs +-- ---------------------------- + -- ---------------------------- -- Table structure for t_ds_user -- ---------------------------- DROP TABLE IF EXISTS `t_ds_user`; CREATE TABLE `t_ds_user` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'user id', - `user_name` varchar(64) DEFAULT NULL COMMENT 'user name', - `user_password` varchar(64) DEFAULT NULL COMMENT 'user password', - `user_type` tinyint(4) DEFAULT NULL COMMENT 'user type, 0:administrator,1:ordinary user', - `email` varchar(64) DEFAULT NULL COMMENT 'email', - `phone` varchar(11) DEFAULT NULL COMMENT 'phone', - `tenant_id` int(11) DEFAULT -1 COMMENT 'tenant id', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - `queue` varchar(64) DEFAULT NULL COMMENT 'queue', - `state` tinyint(4) DEFAULT '1' COMMENT 'state 0:disable 1:enable', - `time_zone` varchar(32) DEFAULT NULL COMMENT 'time zone', - PRIMARY KEY (`id`), - UNIQUE KEY `user_name_unique` (`user_name`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'user id', + `user_name` varchar(64) DEFAULT NULL COMMENT 'user name', + `user_password` varchar(64) DEFAULT NULL COMMENT 'user password', + `user_type` tinyint(4) DEFAULT NULL COMMENT 'user type, 0:administrator,1:ordinary user', + `email` varchar(64) DEFAULT NULL COMMENT 'email', + `phone` varchar(11) DEFAULT NULL COMMENT 'phone', + `tenant_id` int(11) DEFAULT -1 COMMENT 'tenant id', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + `queue` varchar(64) DEFAULT NULL COMMENT 'queue', + `state` tinyint(4) DEFAULT '1' COMMENT 'state 0:disable 1:enable', + `time_zone` varchar(32) DEFAULT NULL COMMENT 'time zone', + PRIMARY KEY (`id`), + UNIQUE KEY `user_name_unique` (`user_name`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -947,15 +1016,15 @@ CREATE TABLE `t_ds_user` ( -- ---------------------------- 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', - `description` text NULL DEFAULT NULL COMMENT 'description', - `other_params_json` text NULL DEFAULT NULL COMMENT 'other params json', - PRIMARY KEY (`id`), - UNIQUE KEY `name_unique` (`name`) + `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', + `description` text NULL DEFAULT NULL COMMENT 'description', + `other_params_json` text NULL DEFAULT NULL COMMENT 'other params json', + PRIMARY KEY (`id`), + UNIQUE KEY `name_unique` (`name`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -967,10 +1036,10 @@ CREATE TABLE `t_ds_worker_group` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_version`; CREATE TABLE `t_ds_version` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `version` varchar(63) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `version_UNIQUE` (`version`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `version` varchar(63) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `version_UNIQUE` (`version`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE = utf8_bin COMMENT='version'; -- ---------------------------- @@ -998,14 +1067,14 @@ VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', '', -- ---------------------------- DROP TABLE IF EXISTS `t_ds_plugin_define`; CREATE TABLE `t_ds_plugin_define` ( - `id` int NOT NULL AUTO_INCREMENT, - `plugin_name` varchar(255) NOT NULL COMMENT 'the name of plugin eg: email', - `plugin_type` varchar(63) NOT NULL COMMENT 'plugin type . alert=alert plugin, job=job plugin', - `plugin_params` text COMMENT 'plugin params', - `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `t_ds_plugin_define_UN` (`plugin_name`,`plugin_type`) + `id` int NOT NULL AUTO_INCREMENT, + `plugin_name` varchar(255) NOT NULL COMMENT 'the name of plugin eg: email', + `plugin_type` varchar(63) NOT NULL COMMENT 'plugin type . alert=alert plugin, job=job plugin', + `plugin_params` text COMMENT 'plugin params', + `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `t_ds_plugin_define_UN` (`plugin_name`,`plugin_type`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -1013,15 +1082,15 @@ CREATE TABLE `t_ds_plugin_define` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_alert_plugin_instance`; CREATE TABLE `t_ds_alert_plugin_instance` ( - `id` int NOT NULL AUTO_INCREMENT, - `plugin_define_id` int NOT NULL, - `plugin_instance_params` text COMMENT 'plugin instance params. Also contain the params value which user input in web ui.', - `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - `instance_name` varchar(255) DEFAULT NULL COMMENT 'alert instance name', - `instance_type` int NOT NULL default '0', - `warning_type` int NOT NULL default '3', - PRIMARY KEY (`id`) + `id` int NOT NULL AUTO_INCREMENT, + `plugin_define_id` int NOT NULL, + `plugin_instance_params` text COMMENT 'plugin instance params. Also contain the params value which user input in web ui.', + `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `instance_name` varchar(255) DEFAULT NULL COMMENT 'alert instance name', + `instance_type` int NOT NULL default '0', + `warning_type` int NOT NULL default '3', + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; @@ -1030,13 +1099,13 @@ CREATE TABLE `t_ds_alert_plugin_instance` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_relation_project_worker_group`; CREATE TABLE `t_ds_relation_project_worker_group` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `project_code` bigint(20) NOT NULL COMMENT 'project code', - `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker group', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY unique_project_worker_group(project_code,worker_group) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `project_code` bigint(20) NOT NULL COMMENT 'project code', + `worker_group` varchar(255) DEFAULT NULL COMMENT 'worker group', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY unique_project_worker_group(project_code,worker_group) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; @@ -1045,15 +1114,15 @@ CREATE TABLE `t_ds_relation_project_worker_group` ( -- DROP TABLE IF EXISTS `t_ds_dq_comparison_type`; CREATE TABLE `t_ds_dq_comparison_type` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `type` varchar(255) NOT NULL, - `execute_sql` text DEFAULT NULL, - `output_table` varchar(100) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - `is_inner_source` tinyint(1) DEFAULT '0', - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `type` varchar(255) NOT NULL, + `execute_sql` text DEFAULT NULL, + `output_table` varchar(100) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + `is_inner_source` tinyint(1) DEFAULT '0', + PRIMARY KEY (`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; @@ -1087,25 +1156,25 @@ VALUES(8, 'TargetTableTotalRows', 'SELECT COUNT(*) AS total FROM ${target_table} -- DROP TABLE IF EXISTS `t_ds_dq_execute_result`; CREATE TABLE `t_ds_dq_execute_result` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `process_definition_id` int(11) DEFAULT NULL, - `process_instance_id` int(11) DEFAULT NULL, - `task_instance_id` int(11) DEFAULT NULL, - `rule_type` int(11) DEFAULT NULL, - `rule_name` varchar(255) DEFAULT NULL, - `statistics_value` double DEFAULT NULL, - `comparison_value` double DEFAULT NULL, - `check_type` int(11) DEFAULT NULL, - `threshold` double DEFAULT NULL, - `operator` int(11) DEFAULT NULL, - `failure_strategy` int(11) DEFAULT NULL, - `state` int(11) DEFAULT NULL, - `user_id` int(11) DEFAULT NULL, - `comparison_type` int(11) DEFAULT NULL, - `error_output_path` text DEFAULT NULL, - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `process_definition_id` int(11) DEFAULT NULL, + `process_instance_id` int(11) DEFAULT NULL, + `task_instance_id` int(11) DEFAULT NULL, + `rule_type` int(11) DEFAULT NULL, + `rule_name` varchar(255) DEFAULT NULL, + `statistics_value` double DEFAULT NULL, + `comparison_value` double DEFAULT NULL, + `check_type` int(11) DEFAULT NULL, + `threshold` double DEFAULT NULL, + `operator` int(11) DEFAULT NULL, + `failure_strategy` int(11) DEFAULT NULL, + `state` int(11) DEFAULT NULL, + `user_id` int(11) DEFAULT NULL, + `comparison_type` int(11) DEFAULT NULL, + `error_output_path` text DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- @@ -1113,13 +1182,13 @@ CREATE TABLE `t_ds_dq_execute_result` ( -- DROP TABLE IF EXISTS `t_ds_dq_rule`; CREATE TABLE `t_ds_dq_rule` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) DEFAULT NULL, - `type` int(11) DEFAULT NULL, - `user_id` int(11) DEFAULT NULL, - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `type` int(11) DEFAULT NULL, + `user_id` int(11) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; INSERT IGNORE INTO `t_ds_dq_rule` @@ -1158,15 +1227,15 @@ VALUES(10, '$t(table_count_check)', 0, 1, current_timestamp, current_timestamp); -- DROP TABLE IF EXISTS `t_ds_dq_rule_execute_sql`; CREATE TABLE `t_ds_dq_rule_execute_sql` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `index` int(11) DEFAULT NULL, - `sql` text DEFAULT NULL, - `table_alias` varchar(255) DEFAULT NULL, - `type` int(11) DEFAULT NULL, - `is_error_output_sql` tinyint(1) DEFAULT '0', - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `index` int(11) DEFAULT NULL, + `sql` text DEFAULT NULL, + `table_alias` varchar(255) DEFAULT NULL, + `type` int(11) DEFAULT NULL, + `is_error_output_sql` tinyint(1) DEFAULT '0', + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; INSERT IGNORE INTO `t_ds_dq_rule_execute_sql` @@ -1226,23 +1295,23 @@ VALUES(17, 1, 'SELECT * FROM ${src_table} WHERE (length(${src_field}) ${logic_op -- DROP TABLE IF EXISTS `t_ds_dq_rule_input_entry`; CREATE TABLE `t_ds_dq_rule_input_entry` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `field` varchar(255) DEFAULT NULL, - `type` varchar(255) DEFAULT NULL, - `title` varchar(255) DEFAULT NULL, - `data` varchar(255) DEFAULT NULL, - `options` text DEFAULT NULL, - `placeholder` varchar(255) DEFAULT NULL, - `option_source_type` int(11) DEFAULT NULL, - `data_type` int(11) DEFAULT NULL, - `input_type` int(11) DEFAULT NULL, - `is_show` tinyint(1) DEFAULT '1', - `can_edit` tinyint(1) DEFAULT '1', - `is_emit` tinyint(1) DEFAULT '0', - `is_validate` tinyint(1) DEFAULT '1', - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `field` varchar(255) DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + `data` varchar(255) DEFAULT NULL, + `options` text DEFAULT NULL, + `placeholder` varchar(255) DEFAULT NULL, + `option_source_type` int(11) DEFAULT NULL, + `data_type` int(11) DEFAULT NULL, + `input_type` int(11) DEFAULT NULL, + `is_show` tinyint(1) DEFAULT '1', + `can_edit` tinyint(1) DEFAULT '1', + `is_emit` tinyint(1) DEFAULT '0', + `is_validate` tinyint(1) DEFAULT '1', + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; INSERT IGNORE INTO `t_ds_dq_rule_input_entry` @@ -1344,17 +1413,17 @@ VALUES(31, 'target_database', 'select', '$t(target_database)', NULL, NULL, 'Plea -- DROP TABLE IF EXISTS `t_ds_dq_task_statistics_value`; CREATE TABLE `t_ds_dq_task_statistics_value` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `process_definition_id` int(11) DEFAULT NULL, - `task_instance_id` int(11) DEFAULT NULL, - `rule_id` int(11) NOT NULL, - `unique_code` varchar(255) NULL, - `statistics_name` varchar(255) NULL, - `statistics_value` double NULL, - `data_time` datetime DEFAULT NULL, - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `process_definition_id` int(11) DEFAULT NULL, + `task_instance_id` int(11) DEFAULT NULL, + `rule_id` int(11) NOT NULL, + `unique_code` varchar(255) NULL, + `statistics_name` varchar(255) NULL, + `statistics_value` double NULL, + `data_time` datetime DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- @@ -1362,12 +1431,12 @@ CREATE TABLE `t_ds_dq_task_statistics_value` ( -- DROP TABLE IF EXISTS `t_ds_relation_rule_execute_sql`; CREATE TABLE `t_ds_relation_rule_execute_sql` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `rule_id` int(11) DEFAULT NULL, - `execute_sql_id` int(11) DEFAULT NULL, - `create_time` datetime NULL, - `update_time` datetime NULL, - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `rule_id` int(11) DEFAULT NULL, + `execute_sql_id` int(11) DEFAULT NULL, + `create_time` datetime NULL, + `update_time` datetime NULL, + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; INSERT IGNORE INTO `t_ds_relation_rule_execute_sql` @@ -1421,14 +1490,14 @@ VALUES(15, 5, 17, current_timestamp, current_timestamp); -- DROP TABLE IF EXISTS `t_ds_relation_rule_input_entry`; CREATE TABLE `t_ds_relation_rule_input_entry` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `rule_id` int(11) DEFAULT NULL, - `rule_input_entry_id` int(11) DEFAULT NULL, - `values_map` text DEFAULT NULL, - `index` int(11) DEFAULT NULL, - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `rule_id` int(11) DEFAULT NULL, + `rule_input_entry_id` int(11) DEFAULT NULL, + `values_map` text DEFAULT NULL, + `index` int(11) DEFAULT NULL, + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; INSERT IGNORE INTO `t_ds_relation_rule_input_entry` @@ -1866,17 +1935,17 @@ VALUES(162, 4, 31, NULL, 7, current_timestamp, current_timestamp); -- ---------------------------- DROP TABLE IF EXISTS `t_ds_environment`; CREATE TABLE `t_ds_environment` ( - `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id', - `code` bigint(20) DEFAULT NULL COMMENT 'encoding', - `name` varchar(255) NOT NULL COMMENT 'environment name', - `config` text NULL DEFAULT NULL COMMENT 'this config contains many environment variables config', - `description` text NULL DEFAULT NULL COMMENT 'the details', - `operator` int(11) DEFAULT NULL COMMENT 'operator user id', - `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `environment_name_unique` (`name`), - UNIQUE KEY `environment_code_unique` (`code`) + `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id', + `code` bigint(20) DEFAULT NULL COMMENT 'encoding', + `name` varchar(255) NOT NULL COMMENT 'environment name', + `config` text NULL DEFAULT NULL COMMENT 'this config contains many environment variables config', + `description` text NULL DEFAULT NULL COMMENT 'the details', + `operator` int(11) DEFAULT NULL COMMENT 'operator user id', + `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `environment_name_unique` (`name`), + UNIQUE KEY `environment_code_unique` (`code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -1884,14 +1953,14 @@ CREATE TABLE `t_ds_environment` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_environment_worker_group_relation`; CREATE TABLE `t_ds_environment_worker_group_relation` ( - `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id', - `environment_code` bigint(20) NOT NULL COMMENT 'environment code', - `worker_group` varchar(255) NOT NULL COMMENT 'worker group id', - `operator` int(11) DEFAULT NULL COMMENT 'operator user id', - `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `environment_worker_group_unique` (`environment_code`,`worker_group`) + `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id', + `environment_code` bigint(20) NOT NULL COMMENT 'environment code', + `worker_group` varchar(255) NOT NULL COMMENT 'worker group id', + `operator` int(11) DEFAULT NULL COMMENT 'operator user id', + `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `environment_worker_group_unique` (`environment_code`,`worker_group`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -1899,19 +1968,19 @@ CREATE TABLE `t_ds_environment_worker_group_relation` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_task_group_queue`; CREATE TABLE `t_ds_task_group_queue` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT'key', - `task_id` int(11) DEFAULT NULL COMMENT 'taskintanceid', - `task_name` varchar(255) DEFAULT NULL COMMENT 'TaskInstance name', - `group_id` int(11) DEFAULT NULL COMMENT 'taskGroup id', - `process_id` int(11) DEFAULT NULL COMMENT 'processInstace id', - `priority` int(8) DEFAULT '0' COMMENT 'priority', - `status` tinyint(4) DEFAULT '-1' COMMENT '-1: waiting 1: running 2: finished', - `force_start` tinyint(4) DEFAULT '0' COMMENT 'is force start 0 NO ,1 YES', - `in_queue` tinyint(4) DEFAULT '0' COMMENT 'ready to get the queue by other task finish 0 NO ,1 YES', - `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - KEY `idx_t_ds_task_group_queue_in_queue` (`in_queue`), - PRIMARY KEY( `id` ) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT'key', + `task_id` int(11) DEFAULT NULL COMMENT 'taskintanceid', + `task_name` varchar(255) DEFAULT NULL COMMENT 'TaskInstance name', + `group_id` int(11) DEFAULT NULL COMMENT 'taskGroup id', + `process_id` int(11) DEFAULT NULL COMMENT 'processInstace id', + `priority` int(8) DEFAULT '0' COMMENT 'priority', + `status` tinyint(4) DEFAULT '-1' COMMENT '-1: waiting 1: running 2: finished', + `force_start` tinyint(4) DEFAULT '0' COMMENT 'is force start 0 NO ,1 YES', + `in_queue` tinyint(4) DEFAULT '0' COMMENT 'ready to get the queue by other task finish 0 NO ,1 YES', + `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + KEY `idx_t_ds_task_group_queue_in_queue` (`in_queue`), + PRIMARY KEY( `id` ) )ENGINE= INNODB AUTO_INCREMENT= 1 DEFAULT CHARSET= utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -1919,17 +1988,17 @@ CREATE TABLE `t_ds_task_group_queue` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_task_group`; CREATE TABLE `t_ds_task_group` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT'key', - `name` varchar(255) DEFAULT NULL COMMENT 'task_group name', - `description` varchar(255) DEFAULT NULL, - `group_size` int (11) NOT NULL COMMENT'group size', - `use_size` int (11) DEFAULT '0' COMMENT 'used size', - `user_id` int(11) DEFAULT NULL COMMENT 'creator id', - `project_code` bigint(20) DEFAULT 0 COMMENT 'project code', - `status` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available', - `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, - `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY(`id`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT'key', + `name` varchar(255) DEFAULT NULL COMMENT 'task_group name', + `description` varchar(255) DEFAULT NULL, + `group_size` int (11) NOT NULL COMMENT'group size', + `use_size` int (11) DEFAULT '0' COMMENT 'used size', + `user_id` int(11) DEFAULT NULL COMMENT 'creator id', + `project_code` bigint(20) DEFAULT 0 COMMENT 'project code', + `status` tinyint(4) DEFAULT '1' COMMENT '0 not available, 1 available', + `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY(`id`) ) ENGINE= INNODB AUTO_INCREMENT= 1 DEFAULT CHARSET= utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -1937,17 +2006,17 @@ CREATE TABLE `t_ds_task_group` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_audit_log`; CREATE TABLE `t_ds_audit_log` ( - `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT'key', - `user_id` int(11) NOT NULL COMMENT 'user id', - `model_id` bigint(20) DEFAULT NULL COMMENT 'model id', - `model_name` varchar(100) DEFAULT NULL COMMENT 'model name', - `model_type` varchar(100) NOT NULL COMMENT 'model type', - `operation_type` varchar(100) NOT NULL COMMENT 'operation type', - `description` varchar(100) DEFAULT NULL COMMENT 'api description', - `latency` int(11) DEFAULT NULL COMMENT 'api cost milliseconds', - `detail` varchar(100) DEFAULT NULL COMMENT 'object change detail', - `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'operation time', - PRIMARY KEY (`id`) + `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT'key', + `user_id` int(11) NOT NULL COMMENT 'user id', + `model_id` bigint(20) DEFAULT NULL COMMENT 'model id', + `model_name` varchar(100) DEFAULT NULL COMMENT 'model name', + `model_type` varchar(100) NOT NULL COMMENT 'model type', + `operation_type` varchar(100) NOT NULL COMMENT 'operation type', + `description` varchar(100) DEFAULT NULL COMMENT 'api description', + `latency` int(11) DEFAULT NULL COMMENT 'api cost milliseconds', + `detail` varchar(100) DEFAULT NULL COMMENT 'object change detail', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT 'operation time', + PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -1955,12 +2024,12 @@ CREATE TABLE `t_ds_audit_log` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_k8s`; CREATE TABLE `t_ds_k8s` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `k8s_name` varchar(255) DEFAULT NULL, - `k8s_config` text DEFAULT NULL, - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `k8s_name` varchar(255) DEFAULT NULL, + `k8s_config` text DEFAULT NULL, + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`) ) ENGINE= INNODB AUTO_INCREMENT= 1 DEFAULT CHARSET= utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -1968,15 +2037,15 @@ CREATE TABLE `t_ds_k8s` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_k8s_namespace`; CREATE TABLE `t_ds_k8s_namespace` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `code` bigint(20) NOT NULL DEFAULT '0', - `namespace` varchar(255) DEFAULT NULL, - `user_id` int(11) DEFAULT NULL, - `cluster_code` bigint(20) NOT NULL DEFAULT '0', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY `k8s_namespace_unique` (`namespace`,`cluster_code`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `code` bigint(20) NOT NULL DEFAULT '0', + `namespace` varchar(255) DEFAULT NULL, + `user_id` int(11) DEFAULT NULL, + `cluster_code` bigint(20) NOT NULL DEFAULT '0', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `k8s_namespace_unique` (`namespace`,`cluster_code`) ) ENGINE= INNODB AUTO_INCREMENT= 1 DEFAULT CHARSET= utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -1984,14 +2053,14 @@ CREATE TABLE `t_ds_k8s_namespace` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_relation_namespace_user`; CREATE TABLE `t_ds_relation_namespace_user` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `user_id` int(11) NOT NULL COMMENT 'user id', - `namespace_id` int(11) DEFAULT NULL COMMENT 'namespace id', - `perm` int(11) DEFAULT '1' COMMENT 'limits of authority', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - UNIQUE KEY `namespace_user_unique` (`user_id`,`namespace_id`) + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `user_id` int(11) NOT NULL COMMENT 'user id', + `namespace_id` int(11) DEFAULT NULL COMMENT 'namespace id', + `perm` int(11) DEFAULT '1' COMMENT 'limits of authority', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + UNIQUE KEY `namespace_user_unique` (`user_id`,`namespace_id`) ) ENGINE=InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= utf8 COLLATE = utf8_bin; -- ---------------------------- @@ -1999,14 +2068,14 @@ CREATE TABLE `t_ds_relation_namespace_user` ( -- ---------------------------- DROP TABLE IF EXISTS t_ds_alert_send_status; CREATE TABLE t_ds_alert_send_status ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `alert_id` int(11) NOT NULL, - `alert_plugin_instance_id` int(11) NOT NULL, - `send_status` tinyint(4) DEFAULT '0', - `log` text, - `create_time` datetime DEFAULT NULL COMMENT 'create time', - PRIMARY KEY (`id`), - UNIQUE KEY `alert_send_status_unique` (`alert_id`,`alert_plugin_instance_id`) + `id` int(11) NOT NULL AUTO_INCREMENT, + `alert_id` int(11) NOT NULL, + `alert_plugin_instance_id` int(11) NOT NULL, + `send_status` tinyint(4) DEFAULT '0', + `log` text, + `create_time` datetime DEFAULT NULL COMMENT 'create time', + PRIMARY KEY (`id`), + UNIQUE KEY `alert_send_status_unique` (`alert_id`,`alert_plugin_instance_id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; @@ -2047,28 +2116,28 @@ CREATE TABLE `t_ds_fav_task` -- ---------------------------- DROP TABLE IF EXISTS `t_ds_trigger_relation`; CREATE TABLE `t_ds_trigger_relation` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `trigger_type` int(11) NOT NULL DEFAULT '0' COMMENT '0 process 1 task', - `trigger_code` bigint(20) NOT NULL, - `job_id` bigint(20) NOT NULL, - `create_time` datetime DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `t_ds_trigger_relation_trigger_code_IDX` (`trigger_code`), - UNIQUE KEY `t_ds_trigger_relation_UN` (`trigger_type`,`job_id`,`trigger_code`) + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `trigger_type` int(11) NOT NULL DEFAULT '0' COMMENT '0 process 1 task', + `trigger_code` bigint(20) NOT NULL, + `job_id` bigint(20) NOT NULL, + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `t_ds_trigger_relation_trigger_code_IDX` (`trigger_code`), + UNIQUE KEY `t_ds_trigger_relation_UN` (`trigger_type`,`job_id`,`trigger_code`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE = utf8_bin; DROP TABLE IF EXISTS `t_ds_relation_sub_workflow`; CREATE TABLE `t_ds_relation_sub_workflow` ( - `id` bigint NOT NULL AUTO_INCREMENT, - `parent_workflow_instance_id` bigint NOT NULL, - `parent_task_code` bigint NOT NULL, - `sub_workflow_instance_id` bigint NOT NULL, - PRIMARY KEY (`id`), - KEY `idx_parent_workflow_instance_id` (`parent_workflow_instance_id`), - KEY `idx_parent_task_code` (`parent_task_code`), - KEY `idx_sub_workflow_instance_id` (`sub_workflow_instance_id`) + `id` bigint NOT NULL AUTO_INCREMENT, + `parent_workflow_instance_id` bigint NOT NULL, + `parent_task_code` bigint NOT NULL, + `sub_workflow_instance_id` bigint NOT NULL, + PRIMARY KEY (`id`), + KEY `idx_parent_workflow_instance_id` (`parent_workflow_instance_id`), + KEY `idx_parent_task_code` (`parent_task_code`), + KEY `idx_sub_workflow_instance_id` (`sub_workflow_instance_id`) ); -- ---------------------------- @@ -2076,15 +2145,15 @@ CREATE TABLE `t_ds_relation_sub_workflow` ( -- ---------------------------- DROP TABLE IF EXISTS `t_ds_listener_event`; CREATE TABLE `t_ds_listener_event` ( - `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', - `content` text COMMENT 'listener event json content', - `sign` char(64) NOT NULL DEFAULT '' COMMENT 'sign=sha1(content)', - `post_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:wait running,1:success,2:failed,3:partial success', - `event_type` int(11) NOT NULL COMMENT 'listener event type', - `log` text COMMENT 'log', - `create_time` datetime DEFAULT NULL COMMENT 'create time', - `update_time` datetime DEFAULT NULL COMMENT 'update time', - PRIMARY KEY (`id`), - KEY `idx_status` (`post_status`) USING BTREE, - KEY `idx_sign` (`sign`) USING BTREE + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'key', + `content` text COMMENT 'listener event json content', + `sign` char(64) NOT NULL DEFAULT '' COMMENT 'sign=sha1(content)', + `post_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0:wait running,1:success,2:failed,3:partial success', + `event_type` int(11) NOT NULL COMMENT 'listener event type', + `log` text COMMENT 'log', + `create_time` datetime DEFAULT NULL COMMENT 'create time', + `update_time` datetime DEFAULT NULL COMMENT 'update time', + PRIMARY KEY (`id`), + KEY `idx_status` (`post_status`) USING BTREE, + KEY `idx_sign` (`sign`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE = utf8_bin; diff --git a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql index 3cf3c981472a..5c54d557a6b8 100644 --- a/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql +++ b/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_postgresql.sql @@ -28,135 +28,135 @@ DROP TABLE IF EXISTS QRTZ_JOB_DETAILS; DROP TABLE IF EXISTS QRTZ_CALENDARS; CREATE TABLE QRTZ_JOB_DETAILS ( - SCHED_NAME character varying(120) NOT NULL, - JOB_NAME character varying(200) NOT NULL, - JOB_GROUP character varying(200) NOT NULL, - DESCRIPTION character varying(250) NULL, - JOB_CLASS_NAME character varying(250) NOT NULL, - IS_DURABLE boolean NOT NULL, - IS_NONCONCURRENT boolean NOT NULL, - IS_UPDATE_DATA boolean NOT NULL, - REQUESTS_RECOVERY boolean NOT NULL, - JOB_DATA bytea NULL + SCHED_NAME character varying(120) NOT NULL, + JOB_NAME character varying(200) NOT NULL, + JOB_GROUP character varying(200) NOT NULL, + DESCRIPTION character varying(250) NULL, + JOB_CLASS_NAME character varying(250) NOT NULL, + IS_DURABLE boolean NOT NULL, + IS_NONCONCURRENT boolean NOT NULL, + IS_UPDATE_DATA boolean NOT NULL, + REQUESTS_RECOVERY boolean NOT NULL, + JOB_DATA bytea NULL ); alter table QRTZ_JOB_DETAILS add primary key(SCHED_NAME,JOB_NAME,JOB_GROUP); CREATE TABLE QRTZ_TRIGGERS ( - SCHED_NAME character varying(120) NOT NULL, - TRIGGER_NAME character varying(200) NOT NULL, - TRIGGER_GROUP character varying(200) NOT NULL, - JOB_NAME character varying(200) NOT NULL, - JOB_GROUP character varying(200) NOT NULL, - DESCRIPTION character varying(250) NULL, - NEXT_FIRE_TIME BIGINT NULL, - PREV_FIRE_TIME BIGINT NULL, - PRIORITY INTEGER NULL, - TRIGGER_STATE character varying(16) NOT NULL, - TRIGGER_TYPE character varying(8) NOT NULL, - START_TIME BIGINT NOT NULL, - END_TIME BIGINT NULL, - CALENDAR_NAME character varying(200) NULL, - MISFIRE_INSTR SMALLINT NULL, - JOB_DATA bytea NULL + SCHED_NAME character varying(120) NOT NULL, + TRIGGER_NAME character varying(200) NOT NULL, + TRIGGER_GROUP character varying(200) NOT NULL, + JOB_NAME character varying(200) NOT NULL, + JOB_GROUP character varying(200) NOT NULL, + DESCRIPTION character varying(250) NULL, + NEXT_FIRE_TIME BIGINT NULL, + PREV_FIRE_TIME BIGINT NULL, + PRIORITY INTEGER NULL, + TRIGGER_STATE character varying(16) NOT NULL, + TRIGGER_TYPE character varying(8) NOT NULL, + START_TIME BIGINT NOT NULL, + END_TIME BIGINT NULL, + CALENDAR_NAME character varying(200) NULL, + MISFIRE_INSTR SMALLINT NULL, + JOB_DATA bytea NULL ) ; alter table QRTZ_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); CREATE TABLE QRTZ_SIMPLE_TRIGGERS ( - SCHED_NAME character varying(120) NOT NULL, - TRIGGER_NAME character varying(200) NOT NULL, - TRIGGER_GROUP character varying(200) NOT NULL, - REPEAT_COUNT BIGINT NOT NULL, - REPEAT_INTERVAL BIGINT NOT NULL, - TIMES_TRIGGERED BIGINT NOT NULL + SCHED_NAME character varying(120) NOT NULL, + TRIGGER_NAME character varying(200) NOT NULL, + TRIGGER_GROUP character varying(200) NOT NULL, + REPEAT_COUNT BIGINT NOT NULL, + REPEAT_INTERVAL BIGINT NOT NULL, + TIMES_TRIGGERED BIGINT NOT NULL ) ; alter table QRTZ_SIMPLE_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); CREATE TABLE QRTZ_CRON_TRIGGERS ( - SCHED_NAME character varying(120) NOT NULL, - TRIGGER_NAME character varying(200) NOT NULL, - TRIGGER_GROUP character varying(200) NOT NULL, - CRON_EXPRESSION character varying(120) NOT NULL, - TIME_ZONE_ID character varying(80) + SCHED_NAME character varying(120) NOT NULL, + TRIGGER_NAME character varying(200) NOT NULL, + TRIGGER_GROUP character varying(200) NOT NULL, + CRON_EXPRESSION character varying(120) NOT NULL, + TIME_ZONE_ID character varying(80) ) ; alter table QRTZ_CRON_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); CREATE TABLE QRTZ_SIMPROP_TRIGGERS ( - SCHED_NAME character varying(120) NOT NULL, - TRIGGER_NAME character varying(200) NOT NULL, - TRIGGER_GROUP character varying(200) NOT NULL, - STR_PROP_1 character varying(512) NULL, - STR_PROP_2 character varying(512) NULL, - STR_PROP_3 character varying(512) NULL, - INT_PROP_1 INT NULL, - INT_PROP_2 INT NULL, - LONG_PROP_1 BIGINT NULL, - LONG_PROP_2 BIGINT NULL, - DEC_PROP_1 NUMERIC(13,4) NULL, - DEC_PROP_2 NUMERIC(13,4) NULL, - BOOL_PROP_1 boolean NULL, - BOOL_PROP_2 boolean NULL + SCHED_NAME character varying(120) NOT NULL, + TRIGGER_NAME character varying(200) NOT NULL, + TRIGGER_GROUP character varying(200) NOT NULL, + STR_PROP_1 character varying(512) NULL, + STR_PROP_2 character varying(512) NULL, + STR_PROP_3 character varying(512) NULL, + INT_PROP_1 INT NULL, + INT_PROP_2 INT NULL, + LONG_PROP_1 BIGINT NULL, + LONG_PROP_2 BIGINT NULL, + DEC_PROP_1 NUMERIC(13,4) NULL, + DEC_PROP_2 NUMERIC(13,4) NULL, + BOOL_PROP_1 boolean NULL, + BOOL_PROP_2 boolean NULL ) ; alter table QRTZ_SIMPROP_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); CREATE TABLE QRTZ_BLOB_TRIGGERS ( - SCHED_NAME character varying(120) NOT NULL, - TRIGGER_NAME character varying(200) NOT NULL, - TRIGGER_GROUP character varying(200) NOT NULL, - BLOB_DATA bytea NULL + SCHED_NAME character varying(120) NOT NULL, + TRIGGER_NAME character varying(200) NOT NULL, + TRIGGER_GROUP character varying(200) NOT NULL, + BLOB_DATA bytea NULL ) ; alter table QRTZ_BLOB_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP); CREATE TABLE QRTZ_CALENDARS ( - SCHED_NAME character varying(120) NOT NULL, - CALENDAR_NAME character varying(200) NOT NULL, - CALENDAR bytea NOT NULL + SCHED_NAME character varying(120) NOT NULL, + CALENDAR_NAME character varying(200) NOT NULL, + CALENDAR bytea NOT NULL ) ; alter table QRTZ_CALENDARS add primary key(SCHED_NAME,CALENDAR_NAME); CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS ( - SCHED_NAME character varying(120) NOT NULL, - TRIGGER_GROUP character varying(200) NOT NULL + SCHED_NAME character varying(120) NOT NULL, + TRIGGER_GROUP character varying(200) NOT NULL ) ; alter table QRTZ_PAUSED_TRIGGER_GRPS add primary key(SCHED_NAME,TRIGGER_GROUP); CREATE TABLE QRTZ_FIRED_TRIGGERS ( - SCHED_NAME character varying(120) NOT NULL, - ENTRY_ID character varying(200) NOT NULL, - TRIGGER_NAME character varying(200) NOT NULL, - TRIGGER_GROUP character varying(200) NOT NULL, - INSTANCE_NAME character varying(200) NOT NULL, - FIRED_TIME BIGINT NOT NULL, - SCHED_TIME BIGINT NOT NULL, - PRIORITY INTEGER NOT NULL, - STATE character varying(16) NOT NULL, - JOB_NAME character varying(200) NULL, - JOB_GROUP character varying(200) NULL, - IS_NONCONCURRENT boolean NULL, - REQUESTS_RECOVERY boolean NULL + SCHED_NAME character varying(120) NOT NULL, + ENTRY_ID character varying(200) NOT NULL, + TRIGGER_NAME character varying(200) NOT NULL, + TRIGGER_GROUP character varying(200) NOT NULL, + INSTANCE_NAME character varying(200) NOT NULL, + FIRED_TIME BIGINT NOT NULL, + SCHED_TIME BIGINT NOT NULL, + PRIORITY INTEGER NOT NULL, + STATE character varying(16) NOT NULL, + JOB_NAME character varying(200) NULL, + JOB_GROUP character varying(200) NULL, + IS_NONCONCURRENT boolean NULL, + REQUESTS_RECOVERY boolean NULL ) ; alter table QRTZ_FIRED_TRIGGERS add primary key(SCHED_NAME,ENTRY_ID); CREATE TABLE QRTZ_SCHEDULER_STATE ( - SCHED_NAME character varying(120) NOT NULL, - INSTANCE_NAME character varying(200) NOT NULL, - LAST_CHECKIN_TIME BIGINT NOT NULL, - CHECKIN_INTERVAL BIGINT NOT NULL + SCHED_NAME character varying(120) NOT NULL, + INSTANCE_NAME character varying(200) NOT NULL, + LAST_CHECKIN_TIME BIGINT NOT NULL, + CHECKIN_INTERVAL BIGINT NOT NULL ) ; alter table QRTZ_SCHEDULER_STATE add primary key(SCHED_NAME,INSTANCE_NAME); CREATE TABLE QRTZ_LOCKS ( - SCHED_NAME character varying(120) NOT NULL, - LOCK_NAME character varying(40) NOT NULL + SCHED_NAME character varying(120) NOT NULL, + LOCK_NAME character varying(40) NOT NULL ) ; alter table QRTZ_LOCKS add primary key(SCHED_NAME,LOCK_NAME); @@ -191,13 +191,13 @@ CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP); DROP TABLE IF EXISTS t_ds_access_token; CREATE TABLE t_ds_access_token ( - id int NOT NULL , - user_id int DEFAULT NULL , - token varchar(64) DEFAULT NULL , - expire_time timestamp DEFAULT NULL , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + user_id int DEFAULT NULL , + token varchar(64) DEFAULT NULL , + expire_time timestamp DEFAULT NULL , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ) ; -- @@ -206,21 +206,21 @@ CREATE TABLE t_ds_access_token ( DROP TABLE IF EXISTS t_ds_alert; CREATE TABLE t_ds_alert ( - id int NOT NULL , - title varchar(512) DEFAULT NULL , - sign varchar(40) NOT NULL DEFAULT '', - content text , - alert_status int DEFAULT '0' , - warning_type int DEFAULT '2' , - log text , - alertgroup_id int DEFAULT NULL , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - project_code bigint DEFAULT NULL, - process_definition_code bigint DEFAULT NULL, - process_instance_id int DEFAULT NULL , - alert_type int DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + title varchar(512) DEFAULT NULL , + sign varchar(40) NOT NULL DEFAULT '', + content text , + alert_status int DEFAULT '0' , + warning_type int DEFAULT '2' , + log text , + alertgroup_id int DEFAULT NULL , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + project_code bigint DEFAULT NULL, + process_definition_code bigint DEFAULT NULL, + process_instance_id int DEFAULT NULL , + alert_type int DEFAULT NULL , + PRIMARY KEY (id) ); comment on column t_ds_alert.sign is 'sign=sha1(content)'; @@ -233,15 +233,15 @@ create index idx_sign on t_ds_alert (sign); DROP TABLE IF EXISTS t_ds_alertgroup; CREATE TABLE t_ds_alertgroup( - id int NOT NULL, - alert_instance_ids varchar (255) DEFAULT NULL, - create_user_id int4 DEFAULT NULL, - group_name varchar(255) DEFAULT NULL, - description varchar(255) DEFAULT NULL, - create_time timestamp DEFAULT NULL, - update_time timestamp DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT t_ds_alertgroup_name_un UNIQUE (group_name) + id int NOT NULL, + alert_instance_ids varchar (255) DEFAULT NULL, + create_user_id int4 DEFAULT NULL, + group_name varchar(255) DEFAULT NULL, + description varchar(255) DEFAULT NULL, + create_time timestamp DEFAULT NULL, + update_time timestamp DEFAULT NULL, + PRIMARY KEY (id), + CONSTRAINT t_ds_alertgroup_name_un UNIQUE (group_name) ) ; -- @@ -250,27 +250,27 @@ CREATE TABLE t_ds_alertgroup( DROP TABLE IF EXISTS t_ds_command; CREATE TABLE t_ds_command ( - id int NOT NULL , - command_type int DEFAULT NULL , - process_definition_code bigint NOT NULL , - command_param text , - task_depend_type int DEFAULT NULL , - failure_strategy int DEFAULT '0' , - warning_type int DEFAULT '0' , - warning_group_id int DEFAULT NULL , - schedule_time timestamp DEFAULT NULL , - start_time timestamp DEFAULT NULL , - executor_id int DEFAULT NULL , - update_time timestamp DEFAULT NULL , - process_instance_priority int DEFAULT '2' , - worker_group varchar(255), - tenant_code varchar(64) DEFAULT 'default', - environment_code bigint DEFAULT '-1', - dry_run int DEFAULT '0' , - process_instance_id int DEFAULT 0, - process_definition_version int DEFAULT 0, - test_flag int DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + command_type int DEFAULT NULL , + process_definition_code bigint NOT NULL , + command_param text , + task_depend_type int DEFAULT NULL , + failure_strategy int DEFAULT '0' , + warning_type int DEFAULT '0' , + warning_group_id int DEFAULT NULL , + schedule_time timestamp DEFAULT NULL , + start_time timestamp DEFAULT NULL , + executor_id int DEFAULT NULL , + update_time timestamp DEFAULT NULL , + process_instance_priority int DEFAULT '2' , + worker_group varchar(255), + tenant_code varchar(64) DEFAULT 'default', + environment_code bigint DEFAULT '-1', + dry_run int DEFAULT '0' , + process_instance_id int DEFAULT 0, + process_definition_version int DEFAULT 0, + test_flag int DEFAULT NULL , + PRIMARY KEY (id) ) ; create index priority_id_index on t_ds_command (process_instance_priority,id); @@ -281,16 +281,16 @@ create index priority_id_index on t_ds_command (process_instance_priority,id); DROP TABLE IF EXISTS t_ds_datasource; CREATE TABLE t_ds_datasource ( - id int NOT NULL , - name varchar(64) NOT NULL , - note varchar(255) DEFAULT NULL , - type int NOT NULL , - user_id int NOT NULL , - connection_params text NOT NULL , - create_time timestamp NOT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id), - CONSTRAINT t_ds_datasource_name_un UNIQUE (name, type) + id int NOT NULL , + name varchar(64) NOT NULL , + note varchar(255) DEFAULT NULL , + type int NOT NULL , + user_id int NOT NULL , + connection_params text NOT NULL , + create_time timestamp NOT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id), + CONSTRAINT t_ds_datasource_name_un UNIQUE (name, type) ) ; -- @@ -299,28 +299,28 @@ CREATE TABLE t_ds_datasource ( DROP TABLE IF EXISTS t_ds_error_command; CREATE TABLE t_ds_error_command ( - id int NOT NULL , - command_type int DEFAULT NULL , - process_definition_code bigint NOT NULL , - command_param text , - task_depend_type int DEFAULT NULL , - failure_strategy int DEFAULT '0' , - warning_type int DEFAULT '0' , - warning_group_id int DEFAULT NULL , - schedule_time timestamp DEFAULT NULL , - start_time timestamp DEFAULT NULL , - executor_id int DEFAULT NULL , - update_time timestamp DEFAULT NULL , - process_instance_priority int DEFAULT '2' , - worker_group varchar(255), - tenant_code varchar(64) DEFAULT 'default', - environment_code bigint DEFAULT '-1', - dry_run int DEFAULT '0' , - message text , - process_instance_id int DEFAULT 0, - process_definition_version int DEFAULT 0, - test_flag int DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + command_type int DEFAULT NULL , + process_definition_code bigint NOT NULL , + command_param text , + task_depend_type int DEFAULT NULL , + failure_strategy int DEFAULT '0' , + warning_type int DEFAULT '0' , + warning_group_id int DEFAULT NULL , + schedule_time timestamp DEFAULT NULL , + start_time timestamp DEFAULT NULL , + executor_id int DEFAULT NULL , + update_time timestamp DEFAULT NULL , + process_instance_priority int DEFAULT '2' , + worker_group varchar(255), + tenant_code varchar(64) DEFAULT 'default', + environment_code bigint DEFAULT '-1', + dry_run int DEFAULT '0' , + message text , + process_instance_id int DEFAULT 0, + process_definition_version int DEFAULT 0, + test_flag int DEFAULT NULL , + PRIMARY KEY (id) ); -- @@ -329,24 +329,24 @@ CREATE TABLE t_ds_error_command ( DROP TABLE IF EXISTS t_ds_process_definition; CREATE TABLE t_ds_process_definition ( - id int NOT NULL , - code bigint NOT NULL, - name varchar(255) DEFAULT NULL , - version int NOT NULL DEFAULT 1, - description text , - project_code bigint DEFAULT NULL , - release_state int DEFAULT NULL , - user_id int DEFAULT NULL , - global_params text , - locations text , - warning_group_id int DEFAULT NULL , - flag int DEFAULT NULL , - timeout int DEFAULT '0' , - execution_type int DEFAULT '0', - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) , - CONSTRAINT process_definition_unique UNIQUE (name, project_code) + id int NOT NULL , + code bigint NOT NULL, + name varchar(255) DEFAULT NULL , + version int NOT NULL DEFAULT 1, + description text , + project_code bigint DEFAULT NULL , + release_state int DEFAULT NULL , + user_id int DEFAULT NULL , + global_params text , + locations text , + warning_group_id int DEFAULT NULL , + flag int DEFAULT NULL , + timeout int DEFAULT '0' , + execution_type int DEFAULT '0', + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) , + CONSTRAINT process_definition_unique UNIQUE (name, project_code) ) ; create index process_definition_index on t_ds_process_definition (code,id); @@ -357,25 +357,25 @@ create index process_definition_index on t_ds_process_definition (code,id); DROP TABLE IF EXISTS t_ds_process_definition_log; CREATE TABLE t_ds_process_definition_log ( - id int NOT NULL , - code bigint NOT NULL, - name varchar(255) DEFAULT NULL , - version int NOT NULL DEFAULT '1', - description text , - project_code bigint DEFAULT NULL , - release_state int DEFAULT NULL , - user_id int DEFAULT NULL , - global_params text , - locations text , - warning_group_id int DEFAULT NULL , - flag int DEFAULT NULL , - timeout int DEFAULT '0' , - execution_type int DEFAULT '0', - operator int DEFAULT NULL , - operate_time timestamp DEFAULT NULL , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + code bigint NOT NULL, + name varchar(255) DEFAULT NULL , + version int NOT NULL DEFAULT '1', + description text , + project_code bigint DEFAULT NULL , + release_state int DEFAULT NULL , + user_id int DEFAULT NULL , + global_params text , + locations text , + warning_group_id int DEFAULT NULL , + flag int DEFAULT NULL , + timeout int DEFAULT '0' , + execution_type int DEFAULT '0', + operator int DEFAULT NULL , + operate_time timestamp DEFAULT NULL , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ) ; create UNIQUE index uniq_idx_code_version on t_ds_process_definition_log (code,version); @@ -386,35 +386,35 @@ create UNIQUE index uniq_idx_code_version on t_ds_process_definition_log (code,v DROP TABLE IF EXISTS t_ds_task_definition; CREATE TABLE t_ds_task_definition ( - id int NOT NULL , - code bigint NOT NULL, - name varchar(255) DEFAULT NULL , - version int NOT NULL DEFAULT '1', - description text , - project_code bigint DEFAULT NULL , - user_id int DEFAULT NULL , - task_type varchar(50) DEFAULT NULL , - task_execute_type int DEFAULT '0', - task_params text , - flag int DEFAULT NULL , - is_cache int DEFAULT '0', - task_priority int DEFAULT '2' , - worker_group varchar(255) DEFAULT NULL , - environment_code bigint DEFAULT '-1', - fail_retry_times int DEFAULT NULL , - fail_retry_interval int DEFAULT NULL , - timeout_flag int DEFAULT NULL , - timeout_notify_strategy int DEFAULT NULL , - timeout int DEFAULT '0' , - delay_time int DEFAULT '0' , - task_group_id int DEFAULT NULL, - task_group_priority int DEFAULT '0', - resource_ids text , - cpu_quota int DEFAULT '-1' NOT NULL, - memory_max int DEFAULT '-1' NOT NULL, - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + code bigint NOT NULL, + name varchar(255) DEFAULT NULL , + version int NOT NULL DEFAULT '1', + description text , + project_code bigint DEFAULT NULL , + user_id int DEFAULT NULL , + task_type varchar(50) DEFAULT NULL , + task_execute_type int DEFAULT '0', + task_params text , + flag int DEFAULT NULL , + is_cache int DEFAULT '0', + task_priority int DEFAULT '2' , + worker_group varchar(255) DEFAULT NULL , + environment_code bigint DEFAULT '-1', + fail_retry_times int DEFAULT NULL , + fail_retry_interval int DEFAULT NULL , + timeout_flag int DEFAULT NULL , + timeout_notify_strategy int DEFAULT NULL , + timeout int DEFAULT '0' , + delay_time int DEFAULT '0' , + task_group_id int DEFAULT NULL, + task_group_priority int DEFAULT '0', + resource_ids text , + cpu_quota int DEFAULT '-1' NOT NULL, + memory_max int DEFAULT '-1' NOT NULL, + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ) ; create index task_definition_index on t_ds_task_definition (project_code,id); @@ -425,37 +425,37 @@ create index task_definition_index on t_ds_task_definition (project_code,id); DROP TABLE IF EXISTS t_ds_task_definition_log; CREATE TABLE t_ds_task_definition_log ( - id int NOT NULL , - code bigint NOT NULL, - name varchar(255) DEFAULT NULL , - version int NOT NULL DEFAULT '1', - description text , - project_code bigint DEFAULT NULL , - user_id int DEFAULT NULL , - task_type varchar(50) DEFAULT NULL , - task_execute_type int DEFAULT '0', - task_params text , - flag int DEFAULT NULL , - is_cache int DEFAULT '0' , - task_priority int DEFAULT '2' , - worker_group varchar(255) DEFAULT NULL , - environment_code bigint DEFAULT '-1', - fail_retry_times int DEFAULT NULL , - fail_retry_interval int DEFAULT NULL , - timeout_flag int DEFAULT NULL , - timeout_notify_strategy int DEFAULT NULL , - timeout int DEFAULT '0' , - delay_time int DEFAULT '0' , - resource_ids text , - operator int DEFAULT NULL , - task_group_id int DEFAULT NULL, - task_group_priority int DEFAULT '0', - operate_time timestamp DEFAULT NULL , - cpu_quota int DEFAULT '-1' NOT NULL, - memory_max int DEFAULT '-1' NOT NULL, - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + code bigint NOT NULL, + name varchar(255) DEFAULT NULL , + version int NOT NULL DEFAULT '1', + description text , + project_code bigint DEFAULT NULL , + user_id int DEFAULT NULL , + task_type varchar(50) DEFAULT NULL , + task_execute_type int DEFAULT '0', + task_params text , + flag int DEFAULT NULL , + is_cache int DEFAULT '0' , + task_priority int DEFAULT '2' , + worker_group varchar(255) DEFAULT NULL , + environment_code bigint DEFAULT '-1', + fail_retry_times int DEFAULT NULL , + fail_retry_interval int DEFAULT NULL , + timeout_flag int DEFAULT NULL , + timeout_notify_strategy int DEFAULT NULL , + timeout int DEFAULT '0' , + delay_time int DEFAULT '0' , + resource_ids text , + operator int DEFAULT NULL , + task_group_id int DEFAULT NULL, + task_group_priority int DEFAULT '0', + operate_time timestamp DEFAULT NULL , + cpu_quota int DEFAULT '-1' NOT NULL, + memory_max int DEFAULT '-1' NOT NULL, + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ) ; create index idx_task_definition_log_code_version on t_ds_task_definition_log (code,version); @@ -467,20 +467,20 @@ create index idx_task_definition_log_project_code on t_ds_task_definition_log (p DROP TABLE IF EXISTS t_ds_process_task_relation; CREATE TABLE t_ds_process_task_relation ( - id int NOT NULL , - name varchar(255) DEFAULT NULL , - project_code bigint DEFAULT NULL , - process_definition_code bigint DEFAULT NULL , - process_definition_version int DEFAULT NULL , - pre_task_code bigint DEFAULT NULL , - pre_task_version int DEFAULT '0' , - post_task_code bigint DEFAULT NULL , - post_task_version int DEFAULT '0' , - condition_type int DEFAULT NULL , - condition_params text , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + name varchar(255) DEFAULT NULL , + project_code bigint DEFAULT NULL , + process_definition_code bigint DEFAULT NULL , + process_definition_version int DEFAULT NULL , + pre_task_code bigint DEFAULT NULL , + pre_task_version int DEFAULT '0' , + post_task_code bigint DEFAULT NULL , + post_task_version int DEFAULT '0' , + condition_type int DEFAULT NULL , + condition_params text , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ) ; create index process_task_relation_idx_project_code_process_definition_code on t_ds_process_task_relation (project_code,process_definition_code); @@ -493,22 +493,22 @@ create index process_task_relation_idx_post_task_code_version on t_ds_process_ta DROP TABLE IF EXISTS t_ds_process_task_relation_log; CREATE TABLE t_ds_process_task_relation_log ( - id int NOT NULL , - name varchar(255) DEFAULT NULL , - project_code bigint DEFAULT NULL , - process_definition_code bigint DEFAULT NULL , - process_definition_version int DEFAULT NULL , - pre_task_code bigint DEFAULT NULL , - pre_task_version int DEFAULT '0' , - post_task_code bigint DEFAULT NULL , - post_task_version int DEFAULT '0' , - condition_type int DEFAULT NULL , - condition_params text , - operator int DEFAULT NULL , - operate_time timestamp DEFAULT NULL , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + name varchar(255) DEFAULT NULL , + project_code bigint DEFAULT NULL , + process_definition_code bigint DEFAULT NULL , + process_definition_version int DEFAULT NULL , + pre_task_code bigint DEFAULT NULL , + pre_task_version int DEFAULT '0' , + post_task_code bigint DEFAULT NULL , + post_task_version int DEFAULT '0' , + condition_type int DEFAULT NULL , + condition_params text , + operator int DEFAULT NULL , + operate_time timestamp DEFAULT NULL , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ) ; create index process_task_relation_log_idx_project_code_process_definition_code on t_ds_process_task_relation_log (project_code,process_definition_code); @@ -519,47 +519,47 @@ create index process_task_relation_log_idx_project_code_process_definition_code DROP TABLE IF EXISTS t_ds_process_instance; CREATE TABLE t_ds_process_instance ( - id int NOT NULL , - name varchar(255) DEFAULT NULL , - process_definition_code bigint DEFAULT NULL , - process_definition_version int NOT NULL DEFAULT 1 , - project_code bigint DEFAULT NULL , - state int DEFAULT NULL , - state_history text, - recovery int DEFAULT NULL , - start_time timestamp DEFAULT NULL , - end_time timestamp DEFAULT NULL , - run_times int DEFAULT NULL , - host varchar(135) DEFAULT NULL , - command_type int DEFAULT NULL , - command_param text , - task_depend_type int DEFAULT NULL , - max_try_times int DEFAULT '0' , - failure_strategy int DEFAULT '0' , - warning_type int DEFAULT '0' , - warning_group_id int DEFAULT NULL , - schedule_time timestamp DEFAULT NULL , - command_start_time timestamp DEFAULT NULL , - global_params text , - process_instance_json text , - flag int DEFAULT '1' , - update_time timestamp NULL , - is_sub_process int DEFAULT '0' , - executor_id int NOT NULL , - executor_name varchar(64) DEFAULT NULL, - history_cmd text , - dependence_schedule_times text , - process_instance_priority int DEFAULT '2' , - worker_group varchar(255) , - environment_code bigint DEFAULT '-1', - timeout int DEFAULT '0' , - tenant_code varchar(64) DEFAULT 'default', - var_pool text , - dry_run int DEFAULT '0' , - next_process_instance_id int DEFAULT '0', - restart_time timestamp DEFAULT NULL , - test_flag int DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + name varchar(255) DEFAULT NULL , + process_definition_code bigint DEFAULT NULL , + process_definition_version int NOT NULL DEFAULT 1 , + project_code bigint DEFAULT NULL , + state int DEFAULT NULL , + state_history text, + recovery int DEFAULT NULL , + start_time timestamp DEFAULT NULL , + end_time timestamp DEFAULT NULL , + run_times int DEFAULT NULL , + host varchar(135) DEFAULT NULL , + command_type int DEFAULT NULL , + command_param text , + task_depend_type int DEFAULT NULL , + max_try_times int DEFAULT '0' , + failure_strategy int DEFAULT '0' , + warning_type int DEFAULT '0' , + warning_group_id int DEFAULT NULL , + schedule_time timestamp DEFAULT NULL , + command_start_time timestamp DEFAULT NULL , + global_params text , + process_instance_json text , + flag int DEFAULT '1' , + update_time timestamp NULL , + is_sub_process int DEFAULT '0' , + executor_id int NOT NULL , + executor_name varchar(64) DEFAULT NULL, + history_cmd text , + dependence_schedule_times text , + process_instance_priority int DEFAULT '2' , + worker_group varchar(255) , + environment_code bigint DEFAULT '-1', + timeout int DEFAULT '0' , + tenant_code varchar(64) DEFAULT 'default', + var_pool text , + dry_run int DEFAULT '0' , + next_process_instance_id int DEFAULT '0', + restart_time timestamp DEFAULT NULL , + test_flag int DEFAULT NULL , + PRIMARY KEY (id) ) ; create index process_instance_index on t_ds_process_instance (process_definition_code,id); @@ -571,15 +571,15 @@ create index start_time_index on t_ds_process_instance (start_time,end_time); DROP TABLE IF EXISTS t_ds_project; CREATE TABLE t_ds_project ( - id int NOT NULL , - name varchar(255) DEFAULT NULL , - code bigint NOT NULL, - description varchar(255) DEFAULT NULL , - user_id int DEFAULT NULL , - flag int DEFAULT '1' , - create_time timestamp DEFAULT CURRENT_TIMESTAMP , - update_time timestamp DEFAULT CURRENT_TIMESTAMP , - PRIMARY KEY (id) + id int NOT NULL , + name varchar(255) DEFAULT NULL , + code bigint NOT NULL, + description varchar(255) DEFAULT NULL , + user_id int DEFAULT NULL , + flag int DEFAULT '1' , + create_time timestamp DEFAULT CURRENT_TIMESTAMP , + update_time timestamp DEFAULT CURRENT_TIMESTAMP , + PRIMARY KEY (id) ) ; create index user_id_index on t_ds_project (user_id); @@ -592,17 +592,17 @@ CREATE UNIQUE INDEX unique_code on t_ds_project (code); DROP TABLE IF EXISTS t_ds_project_parameter; CREATE TABLE t_ds_project_parameter ( - id int NOT NULL , - param_name varchar(255) NOT NULL , - param_value text NOT NULL , - param_data_type varchar(50) DEFAULT 'VARCHAR', - code bigint NOT NULL, - project_code bigint NOT NULL, - user_id int DEFAULT NULL , - operator int DEFAULT NULL , - create_time timestamp DEFAULT CURRENT_TIMESTAMP , - update_time timestamp DEFAULT CURRENT_TIMESTAMP , - PRIMARY KEY (id) + id int NOT NULL , + param_name varchar(255) NOT NULL , + param_value text NOT NULL , + param_data_type varchar(50) DEFAULT 'VARCHAR', + code bigint NOT NULL, + project_code bigint NOT NULL, + user_id int DEFAULT NULL , + operator int DEFAULT NULL , + create_time timestamp DEFAULT CURRENT_TIMESTAMP , + update_time timestamp DEFAULT CURRENT_TIMESTAMP , + PRIMARY KEY (id) ) ; CREATE UNIQUE INDEX unique_project_parameter_name on t_ds_project_parameter (project_code, param_name); @@ -636,12 +636,12 @@ CREATE UNIQUE INDEX unique_project_preference_code on t_ds_project_preference (c DROP TABLE IF EXISTS t_ds_queue; CREATE TABLE t_ds_queue ( - id int NOT NULL , - queue_name varchar(64) DEFAULT NULL , - queue varchar(64) DEFAULT NULL , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + queue_name varchar(64) DEFAULT NULL , + queue varchar(64) DEFAULT NULL , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ); -- add unique key to t_ds_queue CREATE UNIQUE INDEX unique_queue_name on t_ds_queue (queue_name); @@ -652,13 +652,13 @@ CREATE UNIQUE INDEX unique_queue_name on t_ds_queue (queue_name); DROP TABLE IF EXISTS t_ds_relation_datasource_user; CREATE TABLE t_ds_relation_datasource_user ( - id int NOT NULL , - user_id int NOT NULL , - datasource_id int DEFAULT NULL , - perm int DEFAULT '1' , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + user_id int NOT NULL , + datasource_id int DEFAULT NULL , + perm int DEFAULT '1' , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ) ; -- @@ -667,11 +667,11 @@ CREATE TABLE t_ds_relation_datasource_user ( DROP TABLE IF EXISTS t_ds_relation_process_instance; CREATE TABLE t_ds_relation_process_instance ( - id int NOT NULL , - parent_process_instance_id int DEFAULT NULL , - parent_task_instance_id int DEFAULT NULL , - process_instance_id int DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + parent_process_instance_id int DEFAULT NULL , + parent_task_instance_id int DEFAULT NULL , + process_instance_id int DEFAULT NULL , + PRIMARY KEY (id) ) ; create index idx_relation_process_instance_parent_process_task on t_ds_relation_process_instance (parent_process_instance_id, parent_task_instance_id); create index idx_relation_process_instance_process_instance_id on t_ds_relation_process_instance (process_instance_id); @@ -683,14 +683,14 @@ create index idx_relation_process_instance_process_instance_id on t_ds_relation_ DROP TABLE IF EXISTS t_ds_relation_project_user; CREATE TABLE t_ds_relation_project_user ( - id int NOT NULL , - user_id int NOT NULL , - project_id int DEFAULT NULL , - perm int DEFAULT '1' , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id), - CONSTRAINT t_ds_relation_project_user_un UNIQUE (user_id, project_id) + id int NOT NULL , + user_id int NOT NULL , + project_id int DEFAULT NULL , + perm int DEFAULT '1' , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id), + CONSTRAINT t_ds_relation_project_user_un UNIQUE (user_id, project_id) ) ; create index relation_project_user_id_index on t_ds_relation_project_user (user_id); @@ -700,13 +700,51 @@ create index relation_project_user_id_index on t_ds_relation_project_user (user_ -- Deprecated DROP TABLE IF EXISTS t_ds_relation_resources_user; CREATE TABLE t_ds_relation_resources_user ( - id int NOT NULL , - user_id int NOT NULL , - resources_id int DEFAULT NULL , - perm int DEFAULT '1' , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + user_id int NOT NULL , + resources_id int DEFAULT NULL , + perm int DEFAULT '1' , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) +) ; + +-- +-- Table structure for table t_ds_relation_udfs_user +-- + +DROP TABLE IF EXISTS t_ds_relation_udfs_user; +CREATE TABLE t_ds_relation_udfs_user ( + id int NOT NULL , + user_id int NOT NULL , + udf_id int DEFAULT NULL , + perm int DEFAULT '1' , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) +) ; +; + +-- +-- Table structure for table t_ds_resources +-- +-- Deprecated +DROP TABLE IF EXISTS t_ds_resources; +CREATE TABLE t_ds_resources ( + id int NOT NULL , + alias varchar(64) DEFAULT NULL , + file_name varchar(64) DEFAULT NULL , + description varchar(255) DEFAULT NULL , + user_id int DEFAULT NULL , + type int DEFAULT NULL , + size bigint DEFAULT NULL , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + pid int, + full_name varchar(128), + is_directory boolean DEFAULT FALSE, + PRIMARY KEY (id), + CONSTRAINT t_ds_resources_un UNIQUE (full_name, type) ) ; -- @@ -715,24 +753,24 @@ CREATE TABLE t_ds_relation_resources_user ( DROP TABLE IF EXISTS t_ds_schedules; CREATE TABLE t_ds_schedules ( - id int NOT NULL , - process_definition_code bigint NOT NULL , - start_time timestamp NOT NULL , - end_time timestamp NOT NULL , - timezone_id varchar(40) default NULL , - crontab varchar(255) NOT NULL , - failure_strategy int NOT NULL , - user_id int NOT NULL , - release_state int NOT NULL , - warning_type int NOT NULL , - warning_group_id int DEFAULT NULL , - process_instance_priority int DEFAULT '2' , - worker_group varchar(255), - tenant_code varchar(64) DEFAULT 'default', - environment_code bigint DEFAULT '-1', - create_time timestamp NOT NULL , - update_time timestamp NOT NULL , - PRIMARY KEY (id) + id int NOT NULL , + process_definition_code bigint NOT NULL , + start_time timestamp NOT NULL , + end_time timestamp NOT NULL , + timezone_id varchar(40) default NULL , + crontab varchar(255) NOT NULL , + failure_strategy int NOT NULL , + user_id int NOT NULL , + release_state int NOT NULL , + warning_type int NOT NULL , + warning_group_id int DEFAULT NULL , + process_instance_priority int DEFAULT '2' , + worker_group varchar(255), + tenant_code varchar(64) DEFAULT 'default', + environment_code bigint DEFAULT '-1', + create_time timestamp NOT NULL , + update_time timestamp NOT NULL , + PRIMARY KEY (id) ); -- @@ -741,11 +779,11 @@ CREATE TABLE t_ds_schedules ( DROP TABLE IF EXISTS t_ds_session; CREATE TABLE t_ds_session ( - id varchar(64) NOT NULL , - user_id int DEFAULT NULL , - ip varchar(45) DEFAULT NULL , - last_login_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id varchar(64) NOT NULL , + user_id int DEFAULT NULL , + ip varchar(45) DEFAULT NULL , + last_login_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ); -- @@ -754,47 +792,47 @@ CREATE TABLE t_ds_session ( DROP TABLE IF EXISTS t_ds_task_instance; CREATE TABLE t_ds_task_instance ( - id int NOT NULL , - name varchar(255) DEFAULT NULL , - task_type varchar(50) DEFAULT NULL , - task_execute_type int DEFAULT '0', - task_code bigint NOT NULL, - task_definition_version int NOT NULL DEFAULT '1' , - process_instance_id int DEFAULT NULL , - process_instance_name varchar(255) DEFAULT NULL, - project_code bigint DEFAULT NULL, - state int DEFAULT NULL , - submit_time timestamp DEFAULT NULL , - start_time timestamp DEFAULT NULL , - end_time timestamp DEFAULT NULL , - host varchar(135) DEFAULT NULL , - execute_path varchar(200) DEFAULT NULL , - log_path text DEFAULT NULL , - alert_flag int DEFAULT NULL , - retry_times int DEFAULT '0' , - pid int DEFAULT NULL , - app_link text , - task_params text , - flag int DEFAULT '1' , - is_cache int DEFAULT '0', - cache_key varchar(200) DEFAULT NULL, - retry_interval int DEFAULT NULL , - max_retry_times int DEFAULT NULL , - task_instance_priority int DEFAULT NULL , - worker_group varchar(255), - environment_code bigint DEFAULT '-1', - environment_config text, - executor_id int DEFAULT NULL , - executor_name varchar(64) DEFAULT NULL , - first_submit_time timestamp DEFAULT NULL , - delay_time int DEFAULT '0' , - task_group_id int DEFAULT NULL, - var_pool text , - dry_run int DEFAULT '0' , - cpu_quota int DEFAULT '-1' NOT NULL, - memory_max int DEFAULT '-1' NOT NULL, - test_flag int DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + name varchar(255) DEFAULT NULL , + task_type varchar(50) DEFAULT NULL , + task_execute_type int DEFAULT '0', + task_code bigint NOT NULL, + task_definition_version int NOT NULL DEFAULT '1' , + process_instance_id int DEFAULT NULL , + process_instance_name varchar(255) DEFAULT NULL, + project_code bigint DEFAULT NULL, + state int DEFAULT NULL , + submit_time timestamp DEFAULT NULL , + start_time timestamp DEFAULT NULL , + end_time timestamp DEFAULT NULL , + host varchar(135) DEFAULT NULL , + execute_path varchar(200) DEFAULT NULL , + log_path text DEFAULT NULL , + alert_flag int DEFAULT NULL , + retry_times int DEFAULT '0' , + pid int DEFAULT NULL , + app_link text , + task_params text , + flag int DEFAULT '1' , + is_cache int DEFAULT '0', + cache_key varchar(200) DEFAULT NULL, + retry_interval int DEFAULT NULL , + max_retry_times int DEFAULT NULL , + task_instance_priority int DEFAULT NULL , + worker_group varchar(255), + environment_code bigint DEFAULT '-1', + environment_config text, + executor_id int DEFAULT NULL , + executor_name varchar(64) DEFAULT NULL , + first_submit_time timestamp DEFAULT NULL , + delay_time int DEFAULT '0' , + task_group_id int DEFAULT NULL, + var_pool text , + dry_run int DEFAULT '0' , + cpu_quota int DEFAULT '-1' NOT NULL, + memory_max int DEFAULT '-1' NOT NULL, + test_flag int DEFAULT NULL , + PRIMARY KEY (id) ) ; create index idx_task_instance_code_version on t_ds_task_instance (task_code, task_definition_version); @@ -806,36 +844,59 @@ create index idx_cache_key on t_ds_task_instance (cache_key); DROP TABLE IF EXISTS t_ds_tenant; CREATE TABLE t_ds_tenant ( - id int NOT NULL , - tenant_code varchar(64) DEFAULT NULL , - description varchar(255) DEFAULT NULL , - queue_id int DEFAULT NULL , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id int NOT NULL , + tenant_code varchar(64) DEFAULT NULL , + description varchar(255) DEFAULT NULL , + queue_id int DEFAULT NULL , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ) ; -- add unique key to t_ds_tenant CREATE UNIQUE INDEX unique_tenant_code on t_ds_tenant (tenant_code); +-- +-- Table structure for table t_ds_udfs +-- + +DROP TABLE IF EXISTS t_ds_udfs; +CREATE TABLE t_ds_udfs ( + id int NOT NULL , + user_id int NOT NULL , + func_name varchar(255) NOT NULL , + class_name varchar(255) NOT NULL , + type int NOT NULL , + arg_types varchar(255) DEFAULT NULL , + database varchar(255) DEFAULT NULL , + description varchar(255) DEFAULT NULL , + resource_id int NOT NULL , + resource_name varchar(255) NOT NULL , + create_time timestamp NOT NULL , + update_time timestamp NOT NULL , + PRIMARY KEY (id) +) ; +-- add unique key to t_ds_udfs +CREATE UNIQUE INDEX unique_func_name on t_ds_udfs (func_name); + -- -- Table structure for table t_ds_user -- DROP TABLE IF EXISTS t_ds_user; CREATE TABLE t_ds_user ( - id int NOT NULL , - user_name varchar(64) DEFAULT NULL , - user_password varchar(64) DEFAULT NULL , - user_type int DEFAULT NULL , - email varchar(64) DEFAULT NULL , - phone varchar(11) DEFAULT NULL , - tenant_id int DEFAULT -1 , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - queue varchar(64) DEFAULT NULL , - state int DEFAULT 1 , - time_zone varchar(32) DEFAULT NULL, - PRIMARY KEY (id) + id int NOT NULL , + user_name varchar(64) DEFAULT NULL , + user_password varchar(64) DEFAULT NULL , + user_type int DEFAULT NULL , + email varchar(64) DEFAULT NULL , + phone varchar(11) DEFAULT NULL , + tenant_id int DEFAULT -1 , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + queue varchar(64) DEFAULT NULL , + state int DEFAULT 1 , + time_zone varchar(32) DEFAULT NULL, + PRIMARY KEY (id) ); comment on column t_ds_user.state is 'state 0:disable 1:enable'; @@ -845,9 +906,9 @@ comment on column t_ds_user.state is 'state 0:disable 1:enable'; DROP TABLE IF EXISTS t_ds_version; CREATE TABLE t_ds_version ( - id int NOT NULL , - version varchar(63) NOT NULL, - PRIMARY KEY (id) + id int NOT NULL , + version varchar(63) NOT NULL, + PRIMARY KEY (id) ) ; create index version_index on t_ds_version(version); @@ -857,15 +918,15 @@ create index version_index on t_ds_version(version); DROP TABLE IF EXISTS t_ds_worker_group; CREATE TABLE t_ds_worker_group ( - id bigint NOT NULL , - name varchar(255) NOT NULL , - addr_list text DEFAULT NULL , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - description text DEFAULT NULL, - other_params_json text DEFAULT NULL, - PRIMARY KEY (id) , - CONSTRAINT name_unique UNIQUE (name) + id bigint NOT NULL , + name varchar(255) NOT NULL , + addr_list text DEFAULT NULL , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + description text DEFAULT NULL, + other_params_json text DEFAULT NULL, + PRIMARY KEY (id) , + CONSTRAINT name_unique UNIQUE (name) ) ; -- @@ -874,13 +935,13 @@ CREATE TABLE t_ds_worker_group ( DROP TABLE IF EXISTS t_ds_relation_project_worker_group; CREATE TABLE t_ds_relation_project_worker_group ( - id int NOT NULL , - project_code bigint DEFAULT NULL , - worker_group varchar(255) NOT NULL, - create_time timestamp DEFAULT NULL, - update_time timestamp DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT t_ds_relation_project_worker_group_un UNIQUE (project_code, worker_group) + id int NOT NULL , + project_code bigint DEFAULT NULL , + worker_group varchar(255) NOT NULL, + create_time timestamp DEFAULT NULL, + update_time timestamp DEFAULT NULL, + PRIMARY KEY (id), + CONSTRAINT t_ds_relation_project_worker_group_un UNIQUE (project_code, worker_group) ); DROP SEQUENCE IF EXISTS t_ds_access_token_id_sequence; @@ -941,6 +1002,9 @@ ALTER TABLE t_ds_relation_project_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds DROP SEQUENCE IF EXISTS t_ds_relation_resources_user_id_sequence; CREATE SEQUENCE t_ds_relation_resources_user_id_sequence; ALTER TABLE t_ds_relation_resources_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_resources_user_id_sequence'); +DROP SEQUENCE IF EXISTS t_ds_relation_udfs_user_id_sequence; +CREATE SEQUENCE t_ds_relation_udfs_user_id_sequence; +ALTER TABLE t_ds_relation_udfs_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_udfs_user_id_sequence'); DROP SEQUENCE IF EXISTS t_ds_resources_id_sequence; CREATE SEQUENCE t_ds_resources_id_sequence; @@ -954,6 +1018,9 @@ ALTER TABLE t_ds_task_instance ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_task_in DROP SEQUENCE IF EXISTS t_ds_tenant_id_sequence; CREATE SEQUENCE t_ds_tenant_id_sequence; ALTER TABLE t_ds_tenant ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_tenant_id_sequence'); +DROP SEQUENCE IF EXISTS t_ds_udfs_id_sequence; +CREATE SEQUENCE t_ds_udfs_id_sequence; +ALTER TABLE t_ds_udfs ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_udfs_id_sequence'); DROP SEQUENCE IF EXISTS t_ds_user_id_sequence; CREATE SEQUENCE t_ds_user_id_sequence; ALTER TABLE t_ds_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_user_id_sequence'); @@ -1005,14 +1072,14 @@ INSERT INTO t_ds_version(version) VALUES ('3.3.0'); DROP TABLE IF EXISTS t_ds_plugin_define; CREATE TABLE t_ds_plugin_define ( - id serial NOT NULL, - plugin_name varchar(255) NOT NULL, - plugin_type varchar(63) NOT NULL, - plugin_params text NULL, - create_time timestamp NULL, - update_time timestamp NULL, - CONSTRAINT t_ds_plugin_define_pk PRIMARY KEY (id), - CONSTRAINT t_ds_plugin_define_un UNIQUE (plugin_name, plugin_type) + id serial NOT NULL, + plugin_name varchar(255) NOT NULL, + plugin_type varchar(63) NOT NULL, + plugin_params text NULL, + create_time timestamp NULL, + update_time timestamp NULL, + CONSTRAINT t_ds_plugin_define_pk PRIMARY KEY (id), + CONSTRAINT t_ds_plugin_define_un UNIQUE (plugin_name, plugin_type) ); -- @@ -1021,15 +1088,15 @@ CREATE TABLE t_ds_plugin_define ( DROP TABLE IF EXISTS t_ds_alert_plugin_instance; CREATE TABLE t_ds_alert_plugin_instance ( - id serial NOT NULL, - plugin_define_id int NOT NULL, - plugin_instance_params text NULL, - create_time timestamp NULL, - update_time timestamp NULL, - instance_name varchar(255) NULL, - instance_type int NOT NULL default '0', - warning_type int NOT NULL default '3', - CONSTRAINT t_ds_alert_plugin_instance_pk PRIMARY KEY (id) + id serial NOT NULL, + plugin_define_id int NOT NULL, + plugin_instance_params text NULL, + create_time timestamp NULL, + update_time timestamp NULL, + instance_name varchar(255) NULL, + instance_type int NOT NULL default '0', + warning_type int NOT NULL default '3', + CONSTRAINT t_ds_alert_plugin_instance_pk PRIMARY KEY (id) ); -- @@ -1037,15 +1104,15 @@ CREATE TABLE t_ds_alert_plugin_instance ( -- DROP TABLE IF EXISTS t_ds_dq_comparison_type; CREATE TABLE t_ds_dq_comparison_type ( - id serial NOT NULL, - "type" varchar NOT NULL, - execute_sql varchar NULL, - output_table varchar NULL, - "name" varchar NULL, - create_time timestamp NULL, - update_time timestamp NULL, - is_inner_source bool NULL, - CONSTRAINT t_ds_dq_comparison_type_pk PRIMARY KEY (id) + id serial NOT NULL, + "type" varchar NOT NULL, + execute_sql varchar NULL, + output_table varchar NULL, + "name" varchar NULL, + create_time timestamp NULL, + update_time timestamp NULL, + is_inner_source bool NULL, + CONSTRAINT t_ds_dq_comparison_type_pk PRIMARY KEY (id) ); INSERT INTO t_ds_dq_comparison_type (id, "type", execute_sql, output_table, "name", create_time, update_time, is_inner_source) @@ -1077,25 +1144,25 @@ VALUES(8, 'TargetTableTotalRows', 'SELECT COUNT(*) AS total FROM ${target_table} -- DROP TABLE IF EXISTS t_ds_dq_execute_result; CREATE TABLE t_ds_dq_execute_result ( - id serial NOT NULL, - process_definition_id int4 NULL, - process_instance_id int4 NULL, - task_instance_id int4 NULL, - rule_type int4 NULL, - rule_name varchar(255) DEFAULT NULL, - statistics_value float8 NULL, - comparison_value float8 NULL, - check_type int4 NULL, - threshold float8 NULL, - "operator" int4 NULL, - failure_strategy int4 NULL, - state int4 NULL, - user_id int4 NULL, - create_time timestamp NULL, - update_time timestamp NULL, - comparison_type int4 NULL, - error_output_path text NULL, - CONSTRAINT t_ds_dq_execute_result_pk PRIMARY KEY (id) + id serial NOT NULL, + process_definition_id int4 NULL, + process_instance_id int4 NULL, + task_instance_id int4 NULL, + rule_type int4 NULL, + rule_name varchar(255) DEFAULT NULL, + statistics_value float8 NULL, + comparison_value float8 NULL, + check_type int4 NULL, + threshold float8 NULL, + "operator" int4 NULL, + failure_strategy int4 NULL, + state int4 NULL, + user_id int4 NULL, + create_time timestamp NULL, + update_time timestamp NULL, + comparison_type int4 NULL, + error_output_path text NULL, + CONSTRAINT t_ds_dq_execute_result_pk PRIMARY KEY (id) ); -- @@ -1103,13 +1170,13 @@ CREATE TABLE t_ds_dq_execute_result ( -- DROP TABLE IF EXISTS t_ds_dq_rule; CREATE TABLE t_ds_dq_rule ( - id serial NOT NULL, - "name" varchar(255) DEFAULT NULL, - "type" int4 NULL, - user_id int4 NULL, - create_time timestamp NULL, - update_time timestamp NULL, - CONSTRAINT t_ds_dq_rule_pk PRIMARY KEY (id) + id serial NOT NULL, + "name" varchar(255) DEFAULT NULL, + "type" int4 NULL, + user_id int4 NULL, + create_time timestamp NULL, + update_time timestamp NULL, + CONSTRAINT t_ds_dq_rule_pk PRIMARY KEY (id) ); INSERT INTO t_ds_dq_rule (id, "name", "type", user_id, create_time, update_time) @@ -1147,15 +1214,15 @@ VALUES(10, '$t(table_count_check)', 0, 1, '2020-01-12 00:00:00.000', '2020-01-12 -- DROP TABLE IF EXISTS t_ds_dq_rule_execute_sql; CREATE TABLE t_ds_dq_rule_execute_sql ( - id serial NOT NULL, - "index" int4 NULL, - "sql" text NULL, - table_alias varchar(255) DEFAULT NULL, - "type" int4 NULL, - create_time timestamp NULL, - update_time timestamp NULL, - is_error_output_sql bool NULL, - CONSTRAINT t_ds_dq_rule_execute_sql_pk PRIMARY KEY (id) + id serial NOT NULL, + "index" int4 NULL, + "sql" text NULL, + table_alias varchar(255) DEFAULT NULL, + "type" int4 NULL, + create_time timestamp NULL, + update_time timestamp NULL, + is_error_output_sql bool NULL, + CONSTRAINT t_ds_dq_rule_execute_sql_pk PRIMARY KEY (id) ); INSERT INTO t_ds_dq_rule_execute_sql (id, "index", "sql", table_alias, "type", is_error_output_sql, create_time, update_time) @@ -1214,23 +1281,23 @@ VALUES(17, 1, 'SELECT * FROM ${src_table} WHERE (length(${src_field}) ${logic_op -- DROP TABLE IF EXISTS t_ds_dq_rule_input_entry; CREATE TABLE t_ds_dq_rule_input_entry ( - id serial NOT NULL, - field varchar(255) DEFAULT NULL, - "type" varchar(255) DEFAULT NULL, - title varchar(255) DEFAULT NULL, - data varchar(255) DEFAULT NULL, - "options" text DEFAULT NULL, - placeholder varchar(255) DEFAULT NULL, - option_source_type int4 NULL, - data_type int4 NULL, - input_type int4 NULL, - is_show int2 NULL DEFAULT '1'::smallint, - can_edit int2 NULL DEFAULT '1'::smallint, - is_emit int2 NULL DEFAULT '0'::smallint, - is_validate int2 NULL DEFAULT '0'::smallint, - create_time timestamp NULL, - update_time timestamp NULL, - CONSTRAINT t_ds_dq_rule_input_entry_pk PRIMARY KEY (id) + id serial NOT NULL, + field varchar(255) DEFAULT NULL, + "type" varchar(255) DEFAULT NULL, + title varchar(255) DEFAULT NULL, + data varchar(255) DEFAULT NULL, + "options" text DEFAULT NULL, + placeholder varchar(255) DEFAULT NULL, + option_source_type int4 NULL, + data_type int4 NULL, + input_type int4 NULL, + is_show int2 NULL DEFAULT '1'::smallint, + can_edit int2 NULL DEFAULT '1'::smallint, + is_emit int2 NULL DEFAULT '0'::smallint, + is_validate int2 NULL DEFAULT '0'::smallint, + create_time timestamp NULL, + update_time timestamp NULL, + CONSTRAINT t_ds_dq_rule_input_entry_pk PRIMARY KEY (id) ); INSERT INTO t_ds_dq_rule_input_entry (id, field, "type", title, data, "options", placeholder, option_source_type, data_type, input_type, is_show, can_edit, is_emit, is_validate, create_time, update_time) @@ -1331,17 +1398,17 @@ VALUES(31, 'target_database', 'select', '$t(target_database)', NULL, NULL, 'Plea -- DROP TABLE IF EXISTS t_ds_dq_task_statistics_value; CREATE TABLE t_ds_dq_task_statistics_value ( - id serial NOT NULL, - process_definition_id int4 NOT NULL, - task_instance_id int4 NULL, - rule_id int4 NOT NULL, - unique_code varchar NOT NULL, - statistics_name varchar NULL, - statistics_value float8 NULL, - data_time timestamp(0) NULL, - create_time timestamp(0) NULL, - update_time timestamp(0) NULL, - CONSTRAINT t_ds_dq_task_statistics_value_pk PRIMARY KEY (id) + id serial NOT NULL, + process_definition_id int4 NOT NULL, + task_instance_id int4 NULL, + rule_id int4 NOT NULL, + unique_code varchar NOT NULL, + statistics_name varchar NULL, + statistics_value float8 NULL, + data_time timestamp(0) NULL, + create_time timestamp(0) NULL, + update_time timestamp(0) NULL, + CONSTRAINT t_ds_dq_task_statistics_value_pk PRIMARY KEY (id) ); -- @@ -1349,12 +1416,12 @@ CREATE TABLE t_ds_dq_task_statistics_value ( -- DROP TABLE IF EXISTS t_ds_relation_rule_execute_sql; CREATE TABLE t_ds_relation_rule_execute_sql ( - id serial NOT NULL, - rule_id int4 NULL, - execute_sql_id int4 NULL, - create_time timestamp NULL, - update_time timestamp NULL, - CONSTRAINT t_ds_relation_rule_execute_sql_pk PRIMARY KEY (id) + id serial NOT NULL, + rule_id int4 NULL, + execute_sql_id int4 NULL, + create_time timestamp NULL, + update_time timestamp NULL, + CONSTRAINT t_ds_relation_rule_execute_sql_pk PRIMARY KEY (id) ); INSERT INTO t_ds_relation_rule_execute_sql (id, rule_id, execute_sql_id, create_time, update_time) @@ -1407,14 +1474,14 @@ VALUES(15, 5, 17, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000'); -- DROP TABLE IF EXISTS t_ds_relation_rule_input_entry; CREATE TABLE t_ds_relation_rule_input_entry ( - id serial NOT NULL, - rule_id int4 NULL, - rule_input_entry_id int4 NULL, - values_map text NULL, - "index" int4 NULL, - create_time timestamp NULL, - update_time timestamp NULL, - CONSTRAINT t_ds_relation_rule_input_entry_pk PRIMARY KEY (id) + id serial NOT NULL, + rule_id int4 NULL, + rule_input_entry_id int4 NULL, + values_map text NULL, + "index" int4 NULL, + create_time timestamp NULL, + update_time timestamp NULL, + CONSTRAINT t_ds_relation_rule_input_entry_pk PRIMARY KEY (id) ); INSERT INTO t_ds_relation_rule_input_entry (id, rule_id, rule_input_entry_id, values_map, "index", create_time, update_time) @@ -1851,17 +1918,17 @@ VALUES(162, 4, 31, NULL, 7, '2021-03-03 11:31:24.000', '2021-03-03 11:31:24.000' DROP TABLE IF EXISTS t_ds_environment; CREATE TABLE t_ds_environment ( - id serial NOT NULL, - code bigint NOT NULL, - name varchar(255) DEFAULT NULL, - config text DEFAULT NULL, - description text, - operator int DEFAULT NULL, - create_time timestamp DEFAULT NULL, - update_time timestamp DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT environment_name_unique UNIQUE (name), - CONSTRAINT environment_code_unique UNIQUE (code) + id serial NOT NULL, + code bigint NOT NULL, + name varchar(255) DEFAULT NULL, + config text DEFAULT NULL, + description text, + operator int DEFAULT NULL, + create_time timestamp DEFAULT NULL, + update_time timestamp DEFAULT NULL, + PRIMARY KEY (id), + CONSTRAINT environment_name_unique UNIQUE (name), + CONSTRAINT environment_code_unique UNIQUE (code) ); -- @@ -1870,14 +1937,14 @@ CREATE TABLE t_ds_environment ( DROP TABLE IF EXISTS t_ds_environment_worker_group_relation; CREATE TABLE t_ds_environment_worker_group_relation ( - id serial NOT NULL, - environment_code bigint NOT NULL, - worker_group varchar(255) NOT NULL, - operator int DEFAULT NULL, - create_time timestamp DEFAULT NULL, - update_time timestamp DEFAULT NULL, - PRIMARY KEY (id) , - CONSTRAINT environment_worker_group_unique UNIQUE (environment_code,worker_group) + id serial NOT NULL, + environment_code bigint NOT NULL, + worker_group varchar(255) NOT NULL, + operator int DEFAULT NULL, + create_time timestamp DEFAULT NULL, + update_time timestamp DEFAULT NULL, + PRIMARY KEY (id) , + CONSTRAINT environment_worker_group_unique UNIQUE (environment_code,worker_group) ); -- @@ -1886,18 +1953,18 @@ CREATE TABLE t_ds_environment_worker_group_relation ( DROP TABLE IF EXISTS t_ds_task_group_queue; CREATE TABLE t_ds_task_group_queue ( - id serial NOT NULL, - task_id int DEFAULT NULL , - task_name VARCHAR(255) DEFAULT NULL , - group_id int DEFAULT NULL , - process_id int DEFAULT NULL , - priority int DEFAULT '0' , - status int DEFAULT '-1' , - force_start int DEFAULT '0' , - in_queue int DEFAULT '0' , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id serial NOT NULL, + task_id int DEFAULT NULL , + task_name VARCHAR(255) DEFAULT NULL , + group_id int DEFAULT NULL , + process_id int DEFAULT NULL , + priority int DEFAULT '0' , + status int DEFAULT '-1' , + force_start int DEFAULT '0' , + in_queue int DEFAULT '0' , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ); create index idx_t_ds_task_group_queue_in_queue on t_ds_task_group_queue(in_queue); @@ -1908,17 +1975,17 @@ create index idx_t_ds_task_group_queue_in_queue on t_ds_task_group_queue(in_queu DROP TABLE IF EXISTS t_ds_task_group; CREATE TABLE t_ds_task_group ( - id serial NOT NULL, - name varchar(255) DEFAULT NULL , - description varchar(255) DEFAULT NULL , - group_size int NOT NULL , - project_code bigint DEFAULT '0' , - use_size int DEFAULT '0' , - user_id int DEFAULT NULL , - status int DEFAULT '1' , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY(id) + id serial NOT NULL, + name varchar(255) DEFAULT NULL , + description varchar(255) DEFAULT NULL , + group_size int NOT NULL , + project_code bigint DEFAULT '0' , + use_size int DEFAULT '0' , + user_id int DEFAULT NULL , + status int DEFAULT '1' , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY(id) ); -- ---------------------------- @@ -1926,17 +1993,17 @@ CREATE TABLE t_ds_task_group ( -- ---------------------------- DROP TABLE IF EXISTS t_ds_audit_log; CREATE TABLE t_ds_audit_log ( - id serial NOT NULL, - user_id int NOT NULL, - model_id bigint NOT NULL, - model_name VARCHAR(255) NOT NULL, - model_type VARCHAR(255) NOT NULL, - operation_type VARCHAR(255) NOT NULL, - description VARCHAR(255) NOT NULL, - latency int NOT NULL, - detail VARCHAR(255) DEFAULT NULL, - create_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id serial NOT NULL, + user_id int NOT NULL, + model_id bigint NOT NULL, + model_name VARCHAR(255) NOT NULL, + model_type VARCHAR(255) NOT NULL, + operation_type VARCHAR(255) NOT NULL, + description VARCHAR(255) NOT NULL, + latency int NOT NULL, + detail VARCHAR(255) DEFAULT NULL, + create_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ); -- @@ -1945,12 +2012,12 @@ CREATE TABLE t_ds_audit_log ( DROP TABLE IF EXISTS t_ds_k8s; CREATE TABLE t_ds_k8s ( - id serial NOT NULL, - k8s_name VARCHAR(255) DEFAULT NULL , - k8s_config text , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) + id serial NOT NULL, + k8s_name VARCHAR(255) DEFAULT NULL , + k8s_config text , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) ); -- @@ -1959,15 +2026,15 @@ CREATE TABLE t_ds_k8s ( DROP TABLE IF EXISTS t_ds_k8s_namespace; CREATE TABLE t_ds_k8s_namespace ( - id serial NOT NULL, - code bigint NOT NULL, - namespace varchar(255) DEFAULT NULL , - user_id int DEFAULT NULL, - cluster_code bigint NOT NULL, - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) , - CONSTRAINT k8s_namespace_unique UNIQUE (namespace,cluster_code) + id serial NOT NULL, + code bigint NOT NULL, + namespace varchar(255) DEFAULT NULL , + user_id int DEFAULT NULL, + cluster_code bigint NOT NULL, + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) , + CONSTRAINT k8s_namespace_unique UNIQUE (namespace,cluster_code) ); @@ -1977,14 +2044,14 @@ CREATE TABLE t_ds_k8s_namespace ( DROP TABLE IF EXISTS t_ds_relation_namespace_user; CREATE TABLE t_ds_relation_namespace_user ( - id serial NOT NULL, - user_id int DEFAULT NULL , - namespace_id int DEFAULT NULL , - perm int DEFAULT NULL , - create_time timestamp DEFAULT NULL , - update_time timestamp DEFAULT NULL , - PRIMARY KEY (id) , - CONSTRAINT namespace_user_unique UNIQUE (user_id,namespace_id) + id serial NOT NULL, + user_id int DEFAULT NULL , + namespace_id int DEFAULT NULL , + perm int DEFAULT NULL , + create_time timestamp DEFAULT NULL , + update_time timestamp DEFAULT NULL , + PRIMARY KEY (id) , + CONSTRAINT namespace_user_unique UNIQUE (user_id,namespace_id) ); -- ---------------------------- @@ -1992,14 +2059,14 @@ CREATE TABLE t_ds_relation_namespace_user ( -- ---------------------------- DROP TABLE IF EXISTS t_ds_alert_send_status; CREATE TABLE t_ds_alert_send_status ( - id serial NOT NULL, - alert_id int NOT NULL, - alert_plugin_instance_id int NOT NULL, - send_status int DEFAULT '0', - log text, - create_time timestamp DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT alert_send_status_unique UNIQUE (alert_id,alert_plugin_instance_id) + id serial NOT NULL, + alert_id int NOT NULL, + alert_plugin_instance_id int NOT NULL, + send_status int DEFAULT '0', + log text, + create_time timestamp DEFAULT NULL, + PRIMARY KEY (id), + CONSTRAINT alert_send_status_unique UNIQUE (alert_id,alert_plugin_instance_id) ); @@ -2040,23 +2107,23 @@ CREATE TABLE t_ds_fav_task -- ---------------------------- DROP TABLE IF EXISTS t_ds_trigger_relation; CREATE TABLE t_ds_trigger_relation ( - id serial NOT NULL, - trigger_type int NOT NULL, - trigger_code bigint NOT NULL, - job_id bigint NOT NULL, - create_time timestamp DEFAULT NULL, - update_time timestamp DEFAULT NULL, - PRIMARY KEY (id), - CONSTRAINT t_ds_trigger_relation_unique UNIQUE (trigger_type,job_id,trigger_code) + id serial NOT NULL, + trigger_type int NOT NULL, + trigger_code bigint NOT NULL, + job_id bigint NOT NULL, + create_time timestamp DEFAULT NULL, + update_time timestamp DEFAULT NULL, + PRIMARY KEY (id), + CONSTRAINT t_ds_trigger_relation_unique UNIQUE (trigger_type,job_id,trigger_code) ); DROP TABLE IF EXISTS t_ds_relation_sub_workflow; CREATE TABLE t_ds_relation_sub_workflow ( - id serial NOT NULL, - parent_workflow_instance_id BIGINT NOT NULL, - parent_task_code BIGINT NOT NULL, - sub_workflow_instance_id BIGINT NOT NULL, - PRIMARY KEY (id) + id serial NOT NULL, + parent_workflow_instance_id BIGINT NOT NULL, + parent_task_code BIGINT NOT NULL, + sub_workflow_instance_id BIGINT NOT NULL, + PRIMARY KEY (id) ); CREATE INDEX idx_parent_workflow_instance_id ON t_ds_relation_sub_workflow (parent_workflow_instance_id); CREATE INDEX idx_parent_task_code ON t_ds_relation_sub_workflow (parent_task_code); @@ -2068,15 +2135,15 @@ CREATE INDEX idx_sub_workflow_instance_id ON t_ds_relation_sub_workflow (sub_wor DROP TABLE IF EXISTS t_ds_listener_event; CREATE TABLE t_ds_listener_event( - id int NOT NULL, - content text, - sign varchar(64) NOT NULL DEFAULT '', - post_status int NOT NULL DEFAULT '0', - event_type int NOT NULL, - log text, - create_time timestamp DEFAULT NULL, - update_time timestamp DEFAULT NULL, - PRIMARY KEY (id) + id int NOT NULL, + content text, + sign varchar(64) NOT NULL DEFAULT '', + post_status int NOT NULL DEFAULT '0', + event_type int NOT NULL, + log text, + create_time timestamp DEFAULT NULL, + update_time timestamp DEFAULT NULL, + PRIMARY KEY (id) ); comment on column t_ds_listener_event.sign is 'sign=sha1(content)'; diff --git a/dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/test/java/org/apache/dolphinscheduler/plugin/storage/hdfs/LocalStorageOperatorTest.java b/dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/test/java/org/apache/dolphinscheduler/plugin/storage/hdfs/LocalStorageOperatorTest.java index f6ed76e26558..8c20d92566e1 100644 --- a/dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/test/java/org/apache/dolphinscheduler/plugin/storage/hdfs/LocalStorageOperatorTest.java +++ b/dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/test/java/org/apache/dolphinscheduler/plugin/storage/hdfs/LocalStorageOperatorTest.java @@ -118,13 +118,6 @@ public void testGetStorageBaseDirectory_withTenant_withResourceTypeFile() { .isEqualTo("file:" + Paths.get(resourceBaseDir, tenantCode, Constants.RESOURCE_TYPE_FILE)); } - @Test - public void testGetStorageBaseDirectory_withTenant_withResourceTypeUdf() { - String storageBaseDirectory = storageOperator.getStorageBaseDirectory("default", ResourceType.UDF); - assertThat(storageBaseDirectory) - .isEqualTo("file:" + Paths.get(resourceBaseDir, tenantCode, Constants.RESOURCE_TYPE_UDF)); - } - @Test public void testGetStorageBaseDirectory_withTenant_withResourceTypeAll() { String storageBaseDirectory = storageOperator.getStorageBaseDirectory("default", ResourceType.ALL);