/******rbac******/
drop table if exists p39_privilege;
CREATE TABLE P39_privilege
(
ID mediumint unsigned NOT null auto_increment comment ' Id ',
Pri_name varchar (+) NOT null comment ' permission name ',
Moudle_name varchar (+) NOT null default ' comment ' Module name ',
Controller_name varchar (+) NOT null default ' comment ' controller name ',
Action_name varchar (+) NOT null default ' comment ' method name ',
parent_id mediumint unsigned NOT null default ' 0 ' comment ' ancestor permission id ',
Primary KEY (ID)
) Engine=innodb default Charset=utf8 comment ' permission table ';
drop table if exists p39_role_pri;
CREATE TABLE P39_role_pri
(
pri_id mediumint unsigned not NULL comment ' permission ID ',
role_id mediumint unsigned not NULL comment ' role ID ',
Key pri_id (pri_id),
Key role_id (role_id)
) Engine=innodb default Charset=utf8 comment ' role permission table ';
drop table if exists p39_role;
CREATE TABLE P39_role
(
ID mediumint unsigned NOT null auto_increment comment ' Id ',
Role_name varchar (+) NOT null comment ' role name ',
Primary KEY (ID)
Engine=innodb default Charset=utf8 comment ' role table ';
drop table if exists p39_admin_role;
CREATE TABLE P39_admin_role
(
admin_id mediumint unsigned NOT NULL comment ' administrator ID ',
role_id mediumint unsigned not NULL comment ' role ID ',
Key admin_id (admin_id),
Key role_id (role_id)
) Engine=innodb default Charset=utf8 comment ' Administrator role table ';
drop table if exists p39_admin;
CREATE TABLE P39_admin
(
ID mediumint unsigned NOT null auto_increment comment ' Id ',
Username varchar (+) NOT null comment ' user name ',
Password char (+) NOT null comment ' password ',
Primary KEY (ID)
) Engine=innodb default Charset=utf8 comment ' Administrator table ';
Insert into P39_admin (Id,username,password) VALUES (1, ' root ', ' 21232f297a57a5a743894a0e4a801fc3 ');
Role Permission Table