27 lines
1.4 KiB
SQL
27 lines
1.4 KiB
SQL
-- Author: fruit.com.cn
|
|
-- 后台「转码设置」独立菜单(幂等,仅提交文件,由发布流程执行)
|
|
-- 权限码独立于 episode:upload:否则创作者角色会误得该子菜单,父级不可见时
|
|
-- 会被提升为一级相对路径路由,前端注册报错。
|
|
|
|
INSERT INTO sys_permission (id, code, name, group_name, type, sort)
|
|
VALUES (50000105, 'system:transcode:settings', '转码设置', '后台管理', 'MENU', 7)
|
|
ON CONFLICT (code) DO NOTHING;
|
|
|
|
INSERT INTO sys_menu (id, parent_id, title, route_path, route_name, component, redirect, icon,
|
|
permission_code, type, always_show, affix, sort) VALUES
|
|
(35, 6, '转码设置', 'transcode-settings', 'transcode-settings',
|
|
'views/systemManagement/TranscodeSettingsView', '', '',
|
|
'system:transcode:settings', 'MENU', 0, 0, 7)
|
|
ON CONFLICT (id) DO UPDATE SET parent_id = EXCLUDED.parent_id, title = EXCLUDED.title,
|
|
route_path = EXCLUDED.route_path, route_name = EXCLUDED.route_name,
|
|
component = EXCLUDED.component, redirect = EXCLUDED.redirect, icon = EXCLUDED.icon,
|
|
permission_code = EXCLUDED.permission_code, type = EXCLUDED.type,
|
|
always_show = EXCLUDED.always_show, affix = EXCLUDED.affix, sort = EXCLUDED.sort;
|
|
|
|
INSERT INTO sys_role_menu (id, role_id, menu_id)
|
|
SELECT r.id * 1000000 + m.id, r.id, m.id
|
|
FROM sys_role r
|
|
CROSS JOIN sys_menu m
|
|
WHERE r.code = 'super_admin' AND m.id = 35
|
|
ON CONFLICT DO NOTHING;
|