Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pentaLiker
DolphinScheduler
提交
891df6d5
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,发现更多精彩内容 >>
未验证
提交
891df6d5
编写于
1月 25, 2021
作者:
Z
zhuangchong
提交者:
GitHub
1月 25, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix schema 1.4.0 (#4564)
上级
8be894cb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
177 addition
and
30 deletion
+177
-30
sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
+96
-15
sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql
sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql
+81
-15
未找到文件。
sql/upgrade/1.4.0_schema/mysql/dolphinscheduler_ddl.sql
浏览文件 @
891df6d5
...
...
@@ -16,6 +16,10 @@
*/
SET
sql_mode
=
(
SELECT
REPLACE
(
@@
sql_mode
,
'ONLY_FULL_GROUP_BY'
,
''
));
-- ----------------------------
-- Table structure for t_ds_plugin_define
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_ds_plugin_define`
;
CREATE
TABLE
`t_ds_plugin_define`
(
`id`
int
NOT
NULL
AUTO_INCREMENT
,
...
...
@@ -28,6 +32,13 @@ CREATE TABLE `t_ds_plugin_define` (
UNIQUE
KEY
`t_ds_plugin_define_UN`
(
`plugin_name`
,
`plugin_type`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Records of t_ds_plugin_define
-- ----------------------------
-- ----------------------------
-- Table structure for t_ds_alert_plugin_instance
-- ----------------------------
DROP
TABLE
IF
EXISTS
`t_ds_alert_plugin_instance`
;
CREATE
TABLE
`t_ds_alert_plugin_instance`
(
`id`
int
NOT
NULL
AUTO_INCREMENT
,
...
...
@@ -39,31 +50,101 @@ CREATE TABLE `t_ds_alert_plugin_instance` (
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
ALTER
TABLE
t_ds_process_definition
ADD
COLUMN
`warning_group_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'alert group id'
AFTER
`connects`
;
-- ----------------------------
-- Records of t_ds_alert_plugin_instance
-- ----------------------------
-- uc_dolphin_T_t_ds_process_definition_A_warning_group_id
drop
PROCEDURE
if
EXISTS
uc_dolphin_T_t_ds_process_definition_A_warning_group_id
;
delimiter
d
//
CREATE
PROCEDURE
uc_dolphin_T_t_ds_process_definition_A_warning_group_id
()
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_process_definition'
AND
TABLE_SCHEMA
=
(
SELECT
DATABASE
())
AND
COLUMN_NAME
=
'warning_group_id'
)
THEN
ALTER
TABLE
t_ds_process_definition
ADD
COLUMN
`warning_group_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'alert group id'
AFTER
`connects`
;
END
IF
;
END
;
ALTER
TABLE
t_ds_process_definition_version
ADD
COLUMN
`warning_group_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'alert group id'
AFTER
`connects`
;
d
//
ALTER
TABLE
t_ds_alertgroup
ADD
COLUMN
`alert_instance_ids`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'alert instance ids'
AFTER
`id`
,
ADD
COLUMN
`create_user_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'create user id'
AFTER
`alert_instance_ids`
;
delimiter
;
CALL
uc_dolphin_T_t_ds_process_definition_A_warning_group_id
();
DROP
PROCEDURE
uc_dolphin_T_t_ds_process_definition_A_warning_group_id
;
-- uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
drop
PROCEDURE
if
EXISTS
uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
;
delimiter
d
//
CREATE
PROCEDURE
uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
()
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_process_definition_version'
AND
TABLE_SCHEMA
=
(
SELECT
DATABASE
())
AND
COLUMN_NAME
=
'warning_group_id'
)
THEN
ALTER
TABLE
t_ds_process_definition_version
ADD
COLUMN
`warning_group_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'alert group id'
AFTER
`connects`
;
END
IF
;
END
;
d
//
delimiter
;
CALL
uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
();
DROP
PROCEDURE
uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
;
-- uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
drop
PROCEDURE
if
EXISTS
uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
;
delimiter
d
//
CREATE
PROCEDURE
uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
()
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_alertgroup'
AND
TABLE_SCHEMA
=
(
SELECT
DATABASE
())
AND
COLUMN_NAME
=
'alert_instance_ids'
)
THEN
ALTER
TABLE
t_ds_alertgroup
ADD
COLUMN
`alert_instance_ids`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'alert instance ids'
AFTER
`id`
;
END
IF
;
END
;
d
//
delimiter
;
CALL
uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
();
DROP
PROCEDURE
uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
;
-- uc_dolphin_T_t_ds_alertgroup_A_create_user_id
drop
PROCEDURE
if
EXISTS
uc_dolphin_T_t_ds_alertgroup_A_create_user_id
;
delimiter
d
//
CREATE
PROCEDURE
uc_dolphin_T_t_ds_alertgroup_A_create_user_id
()
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_alertgroup'
AND
TABLE_SCHEMA
=
(
SELECT
DATABASE
())
AND
COLUMN_NAME
=
'create_user_id'
)
THEN
ALTER
TABLE
t_ds_alertgroup
ADD
COLUMN
`create_user_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'create user id'
AFTER
`alert_instance_ids`
;
END
IF
;
END
;
d
//
delimiter
;
CALL
uc_dolphin_T_t_ds_alertgroup_A_create_user_id
();
DROP
PROCEDURE
uc_dolphin_T_t_ds_alertgroup_A_create_user_id
;
-- ----------------------------
-- These columns will not be used in the new version,if you determine that the historical data is useless, you can delete it using the sql below
-- ----------------------------
/*
ALTER TABLE t_ds_process_definition DROP receivers, DROP receivers_cc;
ALTER TABLE t_ds_process_definition_vers
ion DROP receivers, DROP receivers_cc;
-- ALTER TABLE t_ds_process_definit
ion DROP receivers, DROP receivers_cc;
ALTER TABLE t_ds_alert DROP show_type,DROP alert_type,DROP receivers,
DROP receivers_cc;
-- ALTER TABLE t_ds_process_definition_version DROP receivers,
DROP receivers_cc;
ALTER TABLE t_ds_alertgroup DROP group_type;
DROP TABLE IF EXISTS t_ds_relation_user_alertgroup;
*/
-- ALTER TABLE t_ds_alert DROP show_type,DROP alert_type,DROP receivers,DROP receivers_cc;
-- ALTER TABLE t_ds_alertgroup DROP group_type;
-- DROP TABLE IF EXISTS t_ds_relation_user_alertgroup;
sql/upgrade/1.4.0_schema/postgresql/dolphinscheduler_ddl.sql
浏览文件 @
891df6d5
...
...
@@ -14,6 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-- ----------------------------
-- Table structure for t_ds_plugin_define
-- ----------------------------
DROP
TABLE
IF
EXISTS
t_ds_plugin_define
;
CREATE
TABLE
t_ds_plugin_define
(
id
serial
NOT
NULL
,
...
...
@@ -26,7 +30,9 @@ CREATE TABLE t_ds_plugin_define (
CONSTRAINT
t_ds_plugin_define_un
UNIQUE
(
plugin_name
,
plugin_type
)
);
-- ----------------------------
-- Table structure for t_ds_alert_plugin_instance
-- ----------------------------
DROP
TABLE
IF
EXISTS
t_ds_alert_plugin_instance
;
CREATE
TABLE
t_ds_alert_plugin_instance
(
id
serial
NOT
NULL
,
...
...
@@ -38,28 +44,88 @@ CREATE TABLE t_ds_alert_plugin_instance (
CONSTRAINT
t_ds_alert_plugin_instance_pk
PRIMARY
KEY
(
id
)
);
ALTER
TABLE
t_ds_process_definition
ADD
COLUMN
`warning_group_id`
int4
DEFAULT
NULL
COMMENT
'alert group id'
AFTER
`connects`
;
-- uc_dolphin_T_t_ds_process_definition_A_warning_group_id
delimiter
d
//
CREATE
OR
REPLACE
FUNCTION
uc_dolphin_T_t_ds_process_definition_A_warning_group_id
()
RETURNS
void
AS
$$
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_process_definition'
AND
COLUMN_NAME
=
'warning_group_id'
)
THEN
ALTER
TABLE
t_ds_process_definition
ADD
COLUMN
`warning_group_id`
int4
DEFAULT
NULL
COMMENT
'alert group id'
AFTER
`connects`
;
END
IF
;
END
;
$$
LANGUAGE
plpgsql
;
d
//
delimiter
;
SELECT
uc_dolphin_T_t_ds_process_definition_A_warning_group_id
();
DROP
FUNCTION
IF
EXISTS
uc_dolphin_T_t_ds_process_definition_A_warning_group_id
();
ALTER
TABLE
t_ds_process_definition_version
ADD
COLUMN
`warning_group_id`
int4
DEFAULT
NULL
COMMENT
'alert group id'
AFTER
`connects`
;
-- uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
delimiter
d
//
CREATE
OR
REPLACE
FUNCTION
uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
()
RETURNS
void
AS
$$
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_process_definition_version'
AND
COLUMN_NAME
=
'warning_group_id'
)
THEN
ALTER
TABLE
t_ds_process_definition_version
ADD
COLUMN
`warning_group_id`
int4
DEFAULT
NULL
COMMENT
'alert group id'
AFTER
`connects`
;
END
IF
;
END
;
$$
LANGUAGE
plpgsql
;
d
//
ALTER
TABLE
t_ds_alertgroup
ADD
COLUMN
`alert_instance_ids`
int4
DEFAULT
NULL
COMMENT
'alert instance ids'
AFTER
`id`
;
ADD
COLUMN
`create_user_id`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'create user id'
AFTER
`alert_instance_ids`
,
delimiter
;
SELECT
uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
()
;
DROP
FUNCTION
IF
EXISTS
uc_dolphin_T_t_ds_process_definition_version_A_warning_group_id
();
-- uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
delimiter
d
//
CREATE
OR
REPLACE
FUNCTION
uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
()
RETURNS
void
AS
$$
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_alertgroup'
AND
COLUMN_NAME
=
'alert_instance_ids'
)
THEN
ALTER
TABLE
t_ds_alertgroup
ADD
COLUMN
`alert_instance_ids`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'alert instance ids'
AFTER
`id`
;
END
IF
;
END
;
$$
LANGUAGE
plpgsql
;
d
//
delimiter
;
SELECT
uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
();
DROP
FUNCTION
IF
EXISTS
uc_dolphin_T_t_ds_alertgroup_A_alert_instance_ids
();
-- uc_dolphin_T_t_ds_alertgroup_A_create_user_id
delimiter
d
//
CREATE
OR
REPLACE
FUNCTION
uc_dolphin_T_t_ds_alertgroup_A_create_user_id
()
RETURNS
void
AS
$$
BEGIN
IF
NOT
EXISTS
(
SELECT
1
FROM
information_schema
.
COLUMNS
WHERE
TABLE_NAME
=
't_ds_alertgroup'
AND
COLUMN_NAME
=
'create_user_id'
)
THEN
ALTER
TABLE
t_ds_alertgroup
ADD
COLUMN
`create_user_id`
int4
DEFAULT
NULL
COMMENT
'create user id'
AFTER
`alert_instance_ids`
;
END
IF
;
END
;
$$
LANGUAGE
plpgsql
;
d
//
delimiter
;
SELECT
uc_dolphin_T_t_ds_alertgroup_A_create_user_id
();
DROP
FUNCTION
IF
EXISTS
uc_dolphin_T_t_ds_alertgroup_A_create_user_id
();
-- ----------------------------
-- These columns will not be used in the new version,if you determine that the historical data is useless, you can delete it using the sql below
-- ----------------------------
/*
ALTER TABLE t_ds_process_definition DROP COLUMN "receivers", DROP COLUMN "receivers_cc";
ALTER TABLE t_ds_process_definition_vers
ion DROP COLUMN "receivers", DROP COLUMN "receivers_cc";
-- ALTER TABLE t_ds_process_definit
ion DROP COLUMN "receivers", DROP COLUMN "receivers_cc";
ALTER TABLE t_ds_alert DROP COLUMN "show_type",DROP COLUMN "alert_type",DROP COLUMN "receivers",
DROP COLUMN "receivers_cc";
-- ALTER TABLE t_ds_process_definition_version DROP COLUMN "receivers",
DROP COLUMN "receivers_cc";
ALTER TABLE t_ds_alertgroup DROP COLUMN "group_type
";
-- ALTER TABLE t_ds_alert DROP COLUMN "show_type",DROP COLUMN "alert_type",DROP COLUMN "receivers",DROP COLUMN "receivers_cc
";
DROP TABLE IF EXISTS t_ds_relation_user_alertgroup;
*/
-- ALTER TABLE t_ds_alertgroup DROP COLUMN "group_type";
-- DROP TABLE IF EXISTS t_ds_relation_user_alertgroup;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录