/******RBAC******/

drop table if exists p39_privilege;
create table p39_privilege
(
id mediumint unsigned not null auto_increment comment 'Id',
pri_name varchar(30) not null comment '权限名称',
moudle_name varchar(30) not null default '' comment '模块名称',
controller_name varchar(30) not null default '' comment '控制器名称',
action_name varchar(30) not null default '' comment '方法名称',
parent_id mediumint unsigned not null default '0' comment '上级权限Id',
primary key (id)
)engine=InnoDB default charset=utf8 comment '权限表';

 

drop table if exists p39_role_pri;
create table p39_role_pri
(
pri_id mediumint unsigned not null comment '权限Id',
role_id mediumint unsigned not null comment '角色Id',
key pri_id(pri_id),
key role_id(role_id)
)engine=InnoDB default charset=utf8 comment '角色权限表';


drop table if exists p39_role;
create table p39_role
(
id mediumint unsigned not null auto_increment comment 'Id',
role_name varchar(30) not null comment '角色名称',
primary key (id)
)engine=InnoDB default charset=utf8 comment '角色表';


drop table if exists p39_admin_role;
create table p39_admin_role
(
admin_id mediumint unsigned not null comment '管理员Id',
role_id mediumint unsigned not null comment '角色Id',
key admin_id(admin_id),
key role_id(role_id)
)engine=InnoDB default charset=utf8 comment '管理员角色表';

 

 

drop table if exists p39_admin;
create table p39_admin
(
id mediumint unsigned not null auto_increment comment 'Id',
username varchar(30) not null comment '用户名',
password char(32) not null comment '密码',
primary key (id)
)engine=InnoDB default charset=utf8 comment '管理员表';

insert into p39_admin(id,username,password) values(1,'root',' 21232f297a57a5a743894a0e4a801fc3');