blob: 019bfb5bf82e26de85a00c52ba702f887bc4f646 [file] [log] [blame]
刘洪青fbf49232020-09-29 17:48:43 +08001-- 10.1.init.sql
2
3/*
4将 paas.example.com 替换为 paas.学校域名.edu.cn
5*/
6
7-- 以下脚本为可选操作
8
9/*
10 * 若部署了流程平台、门户的产品
11 * 可初始化云平台下的相关菜单数据
12 */
13
14use admin_center;
15
16-- flow
17-- 如果部署,流程平台,请处理
18
19insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX)
20values ('50', 0, 'flow-api', '管理门户 - 流程接口', '1', '/api/v1/flow-release', 'http://formflow-formflow-svc.formflow.svc.cluster.local:8080/formflow', 1);
21
22commit;
23
24/*
25update TB_MGT_ROUTE
26set
27 URL='http://formflow.paas.example.com'
28where ID='50'; -- todo, modify
29
30commit;
31*/
32
33insert into TB_MGT_ROLE (ID, DELETED, CODE, NAME, MEMO, STATUS)
34values ('50', 0, 'flow-admin', '流程表单管理员', '', '1');
35insert into TB_MGT_ROLE (ID, DELETED, CODE, NAME, MEMO, STATUS)
36values ('51', 0, 'flow-biz', '流程操作员', '业务、应用组、应用相关管理的操作人员', '1');
37
38commit;
39
40
41update TB_MGT_PERMISSION
42 set LFT = LFT+10
43where LFT>=82
44;
45
46update TB_MGT_PERMISSION
47 set RGT = RGT+10
48where RGT>=82
49;
50
51
52insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT)
53values ('50000', 0, 'formflow-manager', '流程管理', '1', '2', '', '/', '1', '1', 50000, 1, 82, 91);
54
55insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT)
56values ('50100', 0, 'formflow', '流程表单', '1', '2', 'su-icon-liuchengbiaodan', '/formflow', '1', '50000', 50100, 2, 83, 84);
57insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT)
58values ('50200', 0, 'workbench', '工作台', '1', '2', 'su-icon-gongzuotai', '/formflow/workbench', '1', '50000', 50200, 2, 85, 86);
59
60insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT)
61values ('50300', 0, 'instanceManage', '实例管理', '1', '2', 'su-icon-shiliguanli', '/formflow/instanceManage', '1', '50000', 50300, 2, 87, 88);
62insert into TB_MGT_PERMISSION (ID, DELETED, CODE, NAME, STATUS, TYPE_, ICON, URL, APPLICATION_ID, PARENT_ID, ORDER_, LEVEL_, LFT, RGT)
63values ('50400', 0, 'agent', '代理代办', '0', '2', 'su-icon-dailidaiban', '/formflow/agent', '1', '50000', 50400, 2, 89, 90);
64
65commit;
66
67
68insert into TB_MGT_ROLE_PERMISSION (ID, DELETED, ROLE_ID, PERMISSION_ID)
69
70select CONCAT('1_', ID) as ID, 0 as DELETED, '1' as ROLE_ID, ID as PERMISSION_ID
71from TB_MGT_PERMISSION
72where (ID like '5____' or ID='1')
73 and CONCAT('1_', ID) not in (select ID from TB_MGT_ROLE_PERMISSION)
74;
75
76insert into TB_MGT_ROLE_PERMISSION (ID, DELETED, ROLE_ID, PERMISSION_ID)
77
78select CONCAT('50_', ID) as ID, 0 as DELETED, '50' as ROLE_ID, ID as PERMISSION_ID
79from TB_MGT_PERMISSION
80where (ID like '5____' or ID='1')
81 and CONCAT('50_', ID) not in (select ID from TB_MGT_ROLE_PERMISSION)
82;
83
84commit;
85
86
87-- 更新 admin-platform 下菜单的访问域
88
89update TB_MGT_PERMISSION
90set
91 ORIGIN='http://admin-platform.paas.example.com'
92where LFT >= 82
93 and RGT <= 91
94;
95
96commit;