Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pentaLiker
DolphinScheduler
提交
00eea95d
DolphinScheduler
项目概览
pentaLiker
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
00eea95d
编写于
10月 31, 2021
作者:
J
JinYong Li
提交者:
GitHub
10月 31, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Optimizing SQL scripts (#6644)
上级
f60e3c21
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
32 deletion
+32
-32
sql/dolphinscheduler_mysql.sql
sql/dolphinscheduler_mysql.sql
+25
-25
sql/dolphinscheduler_postgre.sql
sql/dolphinscheduler_postgre.sql
+7
-7
未找到文件。
sql/dolphinscheduler_mysql.sql
浏览文件 @
00eea95d
...
...
@@ -319,7 +319,9 @@ 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
)
DEFAULT
NULL
COMMENT
'process definition code'
,
`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'
,
...
...
@@ -332,9 +334,7 @@ CREATE TABLE `t_ds_command` (
`process_instance_priority`
int
(
11
)
DEFAULT
NULL
COMMENT
'process instance priority: 0 Highest,1 High,2 Medium,3 Low,4 Lowest'
,
`worker_group`
varchar
(
64
)
COMMENT
'worker group'
,
`environment_code`
bigint
(
20
)
DEFAULT
'-1'
COMMENT
'environment code'
,
`dry_run`
int
NULL
DEFAULT
0
COMMENT
'dry run flag:0 normal, 1 dry run'
,
`process_instance_id`
int
(
11
)
DEFAULT
0
COMMENT
'process instance id'
,
`process_definition_version`
int
(
11
)
DEFAULT
0
COMMENT
'process definition version'
,
`dry_run`
tinyint
(
4
)
DEFAULT
'0'
COMMENT
'dry run flag:0 normal, 1 dry run'
,
PRIMARY
KEY
(
`id`
),
KEY
`priority_id_index`
(
`process_instance_priority`
,
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
;
...
...
@@ -372,7 +372,9 @@ 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
)
DEFAULT
NULL
COMMENT
'process definition code'
,
`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'
,
...
...
@@ -385,9 +387,7 @@ CREATE TABLE `t_ds_error_command` (
`worker_group`
varchar
(
64
)
COMMENT
'worker group'
,
`environment_code`
bigint
(
20
)
DEFAULT
'-1'
COMMENT
'environment code'
,
`message`
text
COMMENT
'message'
,
`dry_run`
int
NULL
DEFAULT
NULL
COMMENT
'dry run flag: 0 normal, 1 dry run'
,
`process_instance_id`
int
(
11
)
DEFAULT
0
COMMENT
'process instance id: 0'
,
`process_definition_version`
int
(
11
)
DEFAULT
0
COMMENT
'process definition version'
,
`dry_run`
tinyint
(
4
)
DEFAULT
'0'
COMMENT
'dry run flag: 0 normal, 1 dry run'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
ROW_FORMAT
=
DYNAMIC
;
...
...
@@ -403,7 +403,7 @@ 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
)
DEFAULT
NULL
COMMENT
'process definition version'
,
`version`
int
(
11
)
DEFAULT
'0'
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'
,
...
...
@@ -415,7 +415,7 @@ CREATE TABLE `t_ds_process_definition` (
`timeout`
int
(
11
)
DEFAULT
'0'
COMMENT
'time out, unit: minute'
,
`tenant_id`
int
(
11
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'tenant id'
,
`create_time`
datetime
NOT
NULL
COMMENT
'create time'
,
`update_time`
datetime
DEFAUL
T
NULL
COMMENT
'update time'
,
`update_time`
datetime
NO
T
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
;
...
...
@@ -432,7 +432,7 @@ 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
(
200
)
DEFAULT
NULL
COMMENT
'process definition name'
,
`version`
int
(
11
)
DEFAULT
NULL
COMMENT
'process definition version'
,
`version`
int
(
11
)
DEFAULT
'0'
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'
,
...
...
@@ -446,7 +446,7 @@ CREATE TABLE `t_ds_process_definition_log` (
`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
DEFAUL
T
NULL
COMMENT
'update time'
,
`update_time`
datetime
NO
T
NULL
COMMENT
'update time'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
;
...
...
@@ -458,7 +458,7 @@ 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
(
200
)
DEFAULT
NULL
COMMENT
'task definition name'
,
`version`
int
(
11
)
DEFAULT
NULL
COMMENT
'task definition version'
,
`version`
int
(
11
)
DEFAULT
'0'
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'
,
...
...
@@ -476,7 +476,7 @@ CREATE TABLE `t_ds_task_definition` (
`delay_time`
int
(
11
)
DEFAULT
'0'
COMMENT
'delay execution time,unit: minute'
,
`resource_ids`
text
COMMENT
'resource id, separated by comma'
,
`create_time`
datetime
NOT
NULL
COMMENT
'create time'
,
`update_time`
datetime
DEFAUL
T
NULL
COMMENT
'update time'
,
`update_time`
datetime
NO
T
NULL
COMMENT
'update time'
,
PRIMARY
KEY
(
`id`
,
`code`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
;
...
...
@@ -488,7 +488,7 @@ 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
(
200
)
DEFAULT
NULL
COMMENT
'task definition name'
,
`version`
int
(
11
)
DEFAULT
NULL
COMMENT
'task definition version'
,
`version`
int
(
11
)
DEFAULT
'0'
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'
,
...
...
@@ -508,7 +508,7 @@ CREATE TABLE `t_ds_task_definition_log` (
`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
DEFAUL
T
NULL
COMMENT
'update time'
,
`update_time`
datetime
NO
T
NULL
COMMENT
'update time'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
;
...
...
@@ -519,9 +519,9 @@ 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
(
200
)
DEFAULT
NULL
COMMENT
'relation name'
,
`process_definition_version`
int
(
11
)
DEFAULT
NULL
COMMENT
'process version'
,
`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'
,
...
...
@@ -529,7 +529,7 @@ CREATE TABLE `t_ds_process_task_relation` (
`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
DEFAUL
T
NULL
COMMENT
'update time'
,
`update_time`
datetime
NO
T
NULL
COMMENT
'update time'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
;
...
...
@@ -540,9 +540,9 @@ 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
(
200
)
DEFAULT
NULL
COMMENT
'relation name'
,
`process_definition_version`
int
(
11
)
DEFAULT
NULL
COMMENT
'process version'
,
`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'
,
...
...
@@ -552,7 +552,7 @@ CREATE TABLE `t_ds_process_task_relation_log` (
`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
DEFAUL
T
NULL
COMMENT
'update time'
,
`update_time`
datetime
NO
T
NULL
COMMENT
'update time'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8
;
...
...
@@ -563,8 +563,8 @@ 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_
version`
int
(
11
)
DEFAULT
NULL
COMMENT
'process definition version
'
,
`process_definition_
code`
bigint
(
20
)
not
NULL
COMMENT
'process definition code
'
,
`process_definition_
code`
bigint
(
20
)
NOT
NULL
COMMENT
'process definition code
'
,
`process_definition_
version`
int
(
11
)
DEFAULT
'0'
COMMENT
'process definition version
'
,
`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'
,
`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'
,
...
...
@@ -592,7 +592,7 @@ CREATE TABLE `t_ds_process_instance` (
`timeout`
int
(
11
)
DEFAULT
'0'
COMMENT
'time out'
,
`tenant_id`
int
(
11
)
NOT
NULL
DEFAULT
'-1'
COMMENT
'tenant id'
,
`var_pool`
longtext
COMMENT
'var_pool'
,
`dry_run`
int
NULL
DEFAULT
0
COMMENT
'dry run flag: 0 normal, 1 dry run
'
,
`dry_run`
tinyint
(
4
)
DEFAULT
'0'
COMMENT
'dry run flag:0 normal, 1 dry run
'
,
PRIMARY
KEY
(
`id`
),
KEY
`process_instance_index`
(
`process_definition_code`
,
`id`
)
USING
BTREE
,
KEY
`start_time_index`
(
`start_time`
)
USING
BTREE
...
...
@@ -804,7 +804,7 @@ CREATE TABLE `t_ds_task_instance` (
`name`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'task name'
,
`task_type`
varchar
(
50
)
NOT
NULL
COMMENT
'task type'
,
`task_code`
bigint
(
20
)
NOT
NULL
COMMENT
'task definition code'
,
`task_definition_version`
int
(
11
)
DEFAULT
NULL
COMMENT
'task definition version'
,
`task_definition_version`
int
(
11
)
DEFAULT
'0'
COMMENT
'task definition version'
,
`process_instance_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'process instance id'
,
`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'
,
...
...
@@ -829,7 +829,7 @@ CREATE TABLE `t_ds_task_instance` (
`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'
,
`dry_run`
int
NULL
DEFAULT
NULL
COMMENT
'dry run flag: 0 normal, 1 dry run'
,
`dry_run`
tinyint
(
4
)
DEFAULT
'0'
COMMENT
'dry run flag: 0 normal, 1 dry run'
,
PRIMARY
KEY
(
`id`
),
KEY
`process_instance_id`
(
`process_instance_id`
)
USING
BTREE
,
CONSTRAINT
`foreign_key_instance_id`
FOREIGN
KEY
(
`process_instance_id`
)
REFERENCES
`t_ds_process_instance`
(
`id`
)
ON
DELETE
CASCADE
...
...
sql/dolphinscheduler_postgre.sql
浏览文件 @
00eea95d
...
...
@@ -320,7 +320,7 @@ CREATE TABLE t_ds_process_definition (
id
int
NOT
NULL
,
code
bigint
NOT
NULL
,
name
varchar
(
255
)
DEFAULT
NULL
,
version
int
DEFAUL
T
NULL
,
version
int
NO
T
NULL
,
description
text
,
project_code
bigint
DEFAULT
NULL
,
release_state
int
DEFAULT
NULL
,
...
...
@@ -344,7 +344,7 @@ CREATE TABLE t_ds_process_definition_log (
id
int
NOT
NULL
,
code
bigint
NOT
NULL
,
name
varchar
(
255
)
DEFAULT
NULL
,
version
int
DEFAUL
T
NULL
,
version
int
NO
T
NULL
,
description
text
,
project_code
bigint
DEFAULT
NULL
,
release_state
int
DEFAULT
NULL
,
...
...
@@ -367,7 +367,7 @@ CREATE TABLE t_ds_task_definition (
id
int
NOT
NULL
,
code
bigint
NOT
NULL
,
name
varchar
(
255
)
DEFAULT
NULL
,
version
int
DEFAUL
T
NULL
,
version
int
NO
T
NULL
,
description
text
,
project_code
bigint
DEFAULT
NULL
,
user_id
int
DEFAULT
NULL
,
...
...
@@ -396,7 +396,7 @@ CREATE TABLE t_ds_task_definition_log (
id
int
NOT
NULL
,
code
bigint
NOT
NULL
,
name
varchar
(
255
)
DEFAULT
NULL
,
version
int
DEFAUL
T
NULL
,
version
int
NO
T
NULL
,
description
text
,
project_code
bigint
DEFAULT
NULL
,
user_id
int
DEFAULT
NULL
,
...
...
@@ -424,9 +424,9 @@ 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
,
process_definition_version
int
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
,
...
...
@@ -442,9 +442,9 @@ 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
,
process_definition_version
int
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
,
...
...
@@ -466,8 +466,8 @@ 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_version
int
DEFAULT
NULL
,
process_definition_code
bigint
DEFAULT
NULL
,
process_definition_version
int
DEFAULT
NULL
,
state
int
DEFAULT
NULL
,
recovery
int
DEFAULT
NULL
,
start_time
timestamp
DEFAULT
NULL
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录