Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
15b06f4d
Unverified
提交
15b06f4d
authored
4月 25, 2022
作者:
王嘉豪
提交者:
GitHub
4月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2180 from dataease/pr@dev@fix_system-mariadb-function
fix: 修复使用mariadb数据库部分函数不兼容问题
上级
51f5cc47
402fddac
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
145 行增加
和
0 行删除
+145
-0
V34__1.10.sql
backend/src/main/resources/db/migration/V34__1.10.sql
+145
-0
没有找到文件。
backend/src/main/resources/db/migration/V34__1.10.sql
浏览文件 @
15b06f4d
...
@@ -16,3 +16,148 @@ INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUE
...
@@ -16,3 +16,148 @@ INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUE
ALTER
TABLE
`my_plugin`
ADD
COLUMN
`ds_type`
VARCHAR
(
45
)
NULL
COMMENT
'数据源类型'
AFTER
`icon`
;
ALTER
TABLE
`my_plugin`
ADD
COLUMN
`ds_type`
VARCHAR
(
45
)
NULL
COMMENT
'数据源类型'
AFTER
`icon`
;
INSERT
INTO
`my_plugin`
(
`plugin_id`
,
`name`
,
`store`
,
`free`
,
`cost`
,
`category`
,
`descript`
,
`version`
,
`creator`
,
`load_mybatis`
,
`install_time`
,
`module_name`
,
`ds_type`
)
VALUES
(
'5'
,
'Maxcompute 数据源插件'
,
'default'
,
'0'
,
'0'
,
'datasource'
,
'Maxcompute 插件'
,
'1.0-SNAPSHOT'
,
'DATAEASE'
,
'0'
,
'1650765903630'
,
'maxcompute-backend'
,
'maxcompute'
);
INSERT
INTO
`my_plugin`
(
`plugin_id`
,
`name`
,
`store`
,
`free`
,
`cost`
,
`category`
,
`descript`
,
`version`
,
`creator`
,
`load_mybatis`
,
`install_time`
,
`module_name`
,
`ds_type`
)
VALUES
(
'5'
,
'Maxcompute 数据源插件'
,
'default'
,
'0'
,
'0'
,
'datasource'
,
'Maxcompute 插件'
,
'1.0-SNAPSHOT'
,
'DATAEASE'
,
'0'
,
'1650765903630'
,
'maxcompute-backend'
,
'maxcompute'
);
DROP
FUNCTION
IF
EXISTS
`copy_auth`
;
delimiter
;;
CREATE
FUNCTION
`copy_auth`
(
authSource
varchar
(
255
),
authSourceType
varchar
(
255
),
authUser
varchar
(
255
))
RETURNS
varchar
(
255
)
CHARSET
utf8mb4
READS
SQL
DATA
BEGIN
DECLARE
authId
varchar
(
255
);
DECLARE
userId
varchar
(
255
);
DECLARE
copyId
varchar
(
255
);
DECLARE
selectPid
varchar
(
255
);
select
uuid
()
into
authId
;
select
uuid
()
into
copyId
;
select
max
(
sys_user
.
user_id
)
into
userId
from
sys_user
where
username
=
authUser
;
SELECT
pid
into
selectPid
FROM
v_auth_model
WHERE
id
=
authSource
AND
model_type
=
authSourceType
;
delete
from
sys_auth_detail
where
auth_id
in
(
select
id
from
sys_auth
where
sys_auth
.
auth_source
=
authSource
and
sys_auth
.
auth_source_type
=
authSourceType
);
delete
from
sys_auth
where
sys_auth
.
auth_source
=
authSource
and
sys_auth
.
auth_source_type
=
authSourceType
;
INSERT
INTO
sys_auth
(
id
,
auth_source
,
auth_source_type
,
auth_target
,
auth_target_type
,
auth_time
,
auth_user
)
VALUES
(
authId
,
authSource
,
authSourceType
,
userId
,
'user'
,
unix_timestamp
(
now
())
*
1000
,
'auto'
);
INSERT
INTO
sys_auth_detail
(
id
,
auth_id
,
privilege_name
,
privilege_type
,
privilege_value
,
privilege_extend
,
remark
,
create_user
,
create_time
)
SELECT
uuid
()
AS
id
,
authId
AS
auth_id
,
sys_auth_detail
.
privilege_name
,
sys_auth_detail
.
privilege_type
,
1
,
sys_auth_detail
.
privilege_extend
,
sys_auth_detail
.
remark
,
'auto'
AS
create_user
,
unix_timestamp
(
now
())
*
1000
AS
create_time
FROM
sys_auth_detail
where
auth_id
=
authSourceType
;
/**继承第一父级权限**/
insert
into
sys_auth
(
id
,
auth_source
,
auth_source_type
,
auth_target
,
auth_target_type
,
auth_time
,
auth_user
,
copy_from
,
copy_id
)
SELECT
uuid
()
as
id
,
authSource
as
auth_source
,
authSourceType
as
auth_source_type
,
auth_target
,
auth_target_type
,
NOW
()
*
1000
as
auth_time
,
'auto'
as
auth_user
,
id
as
copy_from
,
copyId
as
copy_id
FROM
sys_auth
WHERE
auth_source
=
selectPid
AND
auth_source_type
=
authSourceType
and
concat
(
auth_target
,
'-'
,
auth_target_type
)
!=
CONCAT
(
userId
,
'-'
,
'user'
);
INSERT
INTO
sys_auth_detail
(
id
,
auth_id
,
privilege_name
,
privilege_type
,
privilege_value
,
privilege_extend
,
remark
,
create_user
,
create_time
,
copy_from
,
copy_id
)
SELECT
uuid
()
AS
id
,
sa_copy
.
t_id
AS
auth_id
,
sys_auth_detail
.
privilege_name
,
sys_auth_detail
.
privilege_type
,
sys_auth_detail
.
privilege_value
,
sys_auth_detail
.
privilege_extend
,
sys_auth_detail
.
remark
,
'auto'
AS
create_user
,
unix_timestamp
(
now
())
*
1000
AS
create_time
,
id
AS
copy_from
,
copyId
AS
copy_id
FROM
sys_auth_detail
INNER
JOIN
(
SELECT
id
AS
t_id
,
copy_from
AS
s_id
FROM
sys_auth
WHERE
copy_id
=
copyId
)
sa_copy
ON
sys_auth_detail
.
auth_id
=
sa_copy
.
s_id
;
RETURN
'success'
;
END
;;
delimiter
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论