123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- -- ----------------------------
- -- 1、用户信息表
- -- ----------------------------
- drop table if exists sys_user;
- create table sys_user
- (
- user_id bigint(20) not null auto_increment comment '用户ID',
- user_name varchar(30) not null comment '用户账号',
- email varchar(50) default '' comment '用户邮箱',
- telephone varchar(11) default '' comment '手机号码',
- password varchar(100) default '' comment '密码',
- status char(1) default '1' comment '帐号状态(1正常 0停用)',
- login_ip varchar(128) default '' comment '最后登录IP',
- login_date datetime comment '最后登录时间',
- create_by varchar(64) default '' comment '创建者',
- create_time datetime comment '创建时间',
- update_by varchar(64) default '' comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (user_id)
- ) engine = innodb
- auto_increment = 100 comment = '用户信息表';
- -- ----------------------------
- -- 初始化-用户信息表数据
- -- ----------------------------
- insert into sys_user
- values (1, 'admin', 'admin@s-privacy.com', '18099999999',
- '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '1', '127.0.0.1', sysdate(), 'admin',
- sysdate(), '', null, '管理员');
- insert into sys_user
- values (2, 'semi', 'semi@s-privacy.com', '18088888888',
- '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '1', '127.0.0.1', sysdate(), 'admin',
- sysdate(), '', null, '审核员');
- insert into sys_user
- values (3, 'test', 'test@s-privacy.com', '18066666666',
- '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '1', '127.0.0.1', sysdate(), 'admin',
- sysdate(), '', null, '审核员');
- -- ----------------------------
- -- 2、角色信息表
- -- ----------------------------
- drop table if exists sys_role;
- create table sys_role
- (
- role_id bigint(20) not null auto_increment comment '角色ID',
- role_name varchar(30) not null comment '角色名称',
- role_key varchar(100) not null comment '角色权限字符串',
- role_sort int(4) not null comment '显示顺序',
- status char(1) default 1 comment '角色状态(1正常 0停用)',
- create_by varchar(64) default '' comment '创建者',
- create_time datetime comment '创建时间',
- update_by varchar(64) default '' comment '更新者',
- update_time datetime comment '更新时间',
- remark varchar(500) default null comment '备注',
- primary key (role_id)
- ) engine = innodb
- auto_increment = 100 comment = '角色信息表';
- -- ----------------------------
- -- 初始化-角色信息表数据
- -- ----------------------------
- insert into sys_role
- values ('1', '管理员', 'admin', 1, 1, 'admin', sysdate(), '', null, '管理员');
- insert into sys_role
- values ('2', '审核员', 'auditor', 2, 1, 'admin', sysdate(), '', null, '审核员');
- -- ----------------------------
- -- 3、用户和角色关联表 用户N-1角色
- -- ----------------------------
- drop table if exists sys_user_role;
- create table sys_user_role
- (
- user_id bigint(20) not null comment '用户ID',
- role_id bigint(20) not null comment '角色ID',
- primary key (user_id, role_id)
- ) engine = innodb comment = '用户和角色关联表';
- -- ----------------------------
- -- 初始化-用户和角色关联表数据
- -- ----------------------------
- insert into sys_user_role
- values ('1', '1');
- insert into sys_user_role
- values ('2', '2');
- insert into sys_user_role
- values ('3', '2');
|