forked from zhangkaitao/shiro-example
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be73dde
commit 91ff23f
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
drop table if exists sys_users; | ||
drop table if exists sys_roles; | ||
drop table if exists sys_permissions; | ||
drop table if exists sys_users_roles; | ||
drop table if exists sys_roles_permissions; | ||
|
||
create table sys_users ( | ||
id bigint auto_increment, | ||
username varchar(100), | ||
password varchar(100), | ||
salt varchar(100), | ||
locked bool default false, | ||
constraint pk_sys_users primary key(id) | ||
) charset=utf8 ENGINE=InnoDB; | ||
create unique index idx_sys_users_username on sys_users(username); | ||
|
||
create table sys_roles ( | ||
id bigint auto_increment, | ||
role varchar(100), | ||
description varchar(100), | ||
available bool default false, | ||
constraint pk_sys_roles primary key(id) | ||
) charset=utf8 ENGINE=InnoDB; | ||
create unique index idx_sys_roles_role on sys_roles(role); | ||
|
||
create table sys_permissions ( | ||
id bigint auto_increment, | ||
permission varchar(100), | ||
description varchar(100), | ||
available bool default false, | ||
constraint pk_sys_permissions primary key(id) | ||
) charset=utf8 ENGINE=InnoDB; | ||
create unique index idx_sys_permissions_permission on sys_permissions(permission); | ||
|
||
create table sys_users_roles ( | ||
user_id bigint, | ||
role_id bigint, | ||
constraint pk_sys_users_roles primary key(user_id, role_id) | ||
) charset=utf8 ENGINE=InnoDB; | ||
|
||
create table sys_roles_permissions ( | ||
role_id bigint, | ||
permission_id bigint, | ||
constraint pk_sys_roles_permissions primary key(role_id, permission_id) | ||
) charset=utf8 ENGINE=InnoDB; |