Remove redundant field power_id

This commit is contained in:
2023-11-15 14:03:01 +08:00
parent c0c033ad77
commit d334a231df
23 changed files with 52 additions and 117 deletions

View File

@@ -37,52 +37,48 @@ insert into t_power (id, type_id)
as new_value
on duplicate key update type_id = new_value.type_id;
insert into t_module (id, name, power_id)
values (1000000, '系统', id) as new_value
on duplicate key update name = new_value.name,
power_id = new_value.power_id;
insert into t_module (id, name)
values (1000000, '系统') as new_value
on duplicate key update name = new_value.name;
insert into t_menu (id, name, url, power_id, parent_id, module_id)
values (1990000, '系统管理', '/system', id, null, 1000000),
(1010000, '用户管理', '/system/user', id, 1990000, 1000000),
(1020000, '角色管理', '/system/role', id, 1990000, 1000000),
(1030000, '用户组管理', '/system/group', id, 1990000, 1000000) as new_value
insert into t_menu (id, name, url, parent_id, module_id)
values (1990000, '系统管理', '/system', null, 1000000),
(1010000, '用户管理', '/system/user', 1990000, 1000000),
(1020000, '角色管理', '/system/role', 1990000, 1000000),
(1030000, '用户组管理', '/system/group', 1990000, 1000000) as new_value
on duplicate key update name =new_value.name,
url =new_value.url,
power_id =new_value.power_id,
parent_id =new_value.parent_id;
insert into t_element(id, name, power_id, menu_id, parent_id)
values (1010100, '查询', id, 1010000, null),
(1010200, '增加', id, 1010000, 1010100),
(1010300, '修改', id, 1010000, 1010100),
(1020100, '查询', id, 1020000, null),
(1020200, '增加', id, 1020000, 1020100),
(1020300, '修改', id, 1020000, 1020100),
(1020400, '删除', id, 1020000, 1020100),
(1030100, '查询', id, 1030000, null),
(1030200, '增加', id, 1030000, 1030100),
(1030300, '修改', id, 1030000, 1030100),
(1030400, '删除', id, 1030000, 1030100) as new_value
insert into t_element(id, name, menu_id, parent_id)
values (1010100, '查询', 1010000, null),
(1010200, '增加', 1010000, 1010100),
(1010300, '修改', 1010000, 1010100),
(1020100, '查询', 1020000, null),
(1020200, '增加', 1020000, 1020100),
(1020300, '修改', 1020000, 1020100),
(1020400, '删除', 1020000, 1020100),
(1030100, '查询', 1030000, null),
(1030200, '增加', 1030000, 1030100),
(1030300, '修改', 1030000, 1030100),
(1030400, '删除', 1030000, 1030100) as new_value
on duplicate key update name = new_value.name,
power_id=new_value.power_id,
menu_id = new_value.menu_id,
parent_id = new_value.parent_id;
insert into t_operation(id, name, code, power_id, element_id)
values (1010101, '全部', 'system:user:query:all', id, 1010100),
(1010102, '单个', 'system:user:query:one', id, 1010100),
(1010201, '全部', 'system:user:add:all', id, 1010200),
(1010301, '全部', 'system:user:modify:all', id, 1010300),
(1020101, '全部', 'system:role:query:all', id, 1020100),
(1020201, '全部', 'system:role:add:all', id, 1020200),
(1020301, '全部', 'system:role:modify:all', id, 1020300),
(1020401, '全部', 'system:role:delete:all', id, 1020400),
(1030101, '全部', 'system:group:query:all', id, 1030100),
(1030201, '全部', 'system:group:add:all', id, 1030200),
(1030301, '全部', 'system:group:modify:all', id, 1030300),
(1030401, '全部', 'system:group:delete:all', id, 1030400) as new_value
insert into t_operation(id, name, code, element_id)
values (1010101, '全部', 'system:user:query:all', 1010100),
(1010102, '单个', 'system:user:query:one', 1010100),
(1010201, '全部', 'system:user:add:all', 1010200),
(1010301, '全部', 'system:user:modify:all', 1010300),
(1020101, '全部', 'system:role:query:all', 1020100),
(1020201, '全部', 'system:role:add:all', 1020200),
(1020301, '全部', 'system:role:modify:all', 1020300),
(1020401, '全部', 'system:role:delete:all', 1020400),
(1030101, '全部', 'system:group:query:all', 1030100),
(1030201, '全部', 'system:group:add:all', 1030200),
(1030301, '全部', 'system:group:modify:all', 1030300),
(1030401, '全部', 'system:group:delete:all', 1030400) as new_value
on duplicate key update name=new_value.name,
code=new_value.code,
power_id=new_value.power_id,
element_id=new_value.element_id;

View File

@@ -5,7 +5,6 @@ create table if not exists t_menu
id bigint not null primary key,
name varchar(30) not null comment ' 菜单名',
url varchar(100) null comment 'URL',
power_id bigint not null comment '权限ID',
parent_id bigint null comment '父ID',
module_id bigint not null comment '模块ID'
) comment '菜单表';

View File

@@ -4,7 +4,6 @@ create table if not exists t_element
(
id bigint not null primary key,
name varchar(100) not null comment '元素名',
power_id bigint not null comment '权限ID',
parent_id bigint null comment '父ID',
menu_id bigint not null comment '菜单ID'
) comment '页面元素表';

View File

@@ -5,6 +5,5 @@ create table if not exists t_operation
id bigint not null primary key,
name varchar(50) not null comment '功能名',
code varchar(50) null comment '功能编码',
power_id bigint not null comment '权限ID',
element_id bigint not null comment '页面元素ID'
) comment '功能表';

View File

@@ -3,6 +3,5 @@ drop table if exists t_module;
create table if not exists t_module
(
id bigint not null primary key,
name varchar(100) not null comment '模块名',
power_id bigint not null comment '权限ID'
name varchar(100) not null comment '模块名'
) comment '模块表';