-
-
Save jingmian/4971a2d93631dcb1c2c444401134c108 to your computer and use it in GitHub Desktop.
RABC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table it_admin( | |
id int primary key auto_increment, | |
username varchar(32) not null default '' comment "用户名", | |
password char(32) not null default '' comment "用户密码", | |
salt varchar(32) not null default '' comment "辅助密码一个字符串", | |
role_id int not null default 0 comment '用户所属角色id' | |
)engine myisam charset utf8; | |
create table it_role( | |
id int primary key auto_increment, | |
role_name varchar(32) not null default '' comment '角色的名称' | |
role_auth_ids varchar(66) not null default ''comment '记录权限的id', | |
role_auth_ac varchar(128) not null default '' comment '记录该角色的操作' | |
)engine myisam charset utf8; | |
#权限表 | |
create table it_auth( | |
id int primary key auto_increment, | |
auth_name varchar(32) not null default '' comment '权限名称', | |
auth_pid int not null default 0 comment '上级权限的id', | |
auth_path varchar(32) not nulll default '' comment '权限全路径', | |
auth_c varcahr(32) not null default '' comment '执行该权限控制器的名称', | |
auth_a varcahr(32) not null default '' comment '执行该权限方法的名称;, | |
auth_level int not null default '' comment '权限的层级' | |
)engine myisam charset utf8; | |
*************************************第二种******************************** | |
create table vivo_privilege( | |
id mediumint unsigned not null auto_increment comment 'id', | |
pri_name varchar(30) not null comment '权限名称', | |
module_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 '上级权限', | |
primary key (id) | |
)engine=InnoDB default charset=utf8 comment '权限表'; | |
create table vivo_role( | |
id mediumint unsigned not null auto_increment comment 'id', | |
role_name varchar(30) not null comment '角色名称', | |
primary key (id) | |
)ENGINE=MyISAM default charset=utf8 comment '角色表'; | |
create table vivo_role_pri( | |
id mediumint unsigned not null auto_increment comment 'id', | |
pri_id mediumint unsigned not null comment '权限id', | |
role_id mediumint unsigned not null comment '角色id', | |
primary key (id), | |
key pri_id (pri_id ), | |
key role_id (role_id ) | |
)ENGINE=MyISAM default charset=utf8 comment '权限与角色关系表'; | |
create table vivo_admin( | |
id mediumint unsigned not null auto_increment comment 'id', | |
username varchar(30) not null comment '用户名', | |
userpass char(35) not null comment '密码', | |
primary key (id) | |
)ENGINE=MyISAM default charset=utf8 comment '管理员'; | |
create table vivo_admin_role( | |
id mediumint unsigned not null auto_increment comment 'id', | |
admin_id mediumint unsigned not null comment '管理员id', | |
role_id mediumint unsigned not null comment '角色id', | |
primary key (id), | |
key admin_id (admin_id ), | |
key role_id (role_id) | |
)ENGINE=MyISAM default charset=utf8 comment '管理员与角色关系表'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment