| | |
| | | drop table if exists sys_dept; |
| | | create table sys_dept ( |
| | | dept_id bigint(20) not null comment '部门id', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | parent_id bigint(20) default 0 comment '父部门id', |
| | | ancestors varchar(500) default '' comment '祖级列表', |
| | | dept_name varchar(30) default '' comment '部门名称', |
| | |
| | | drop table if exists sys_user; |
| | | create table sys_user ( |
| | | user_id bigint(20) not null comment '用户ID', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | dept_id bigint(20) default null comment '部门ID', |
| | | user_name varchar(30) not null comment '用户账号', |
| | | nick_name varchar(30) not null comment '用户昵称', |
| | |
| | | create table sys_post |
| | | ( |
| | | post_id bigint(20) not null comment '岗位ID', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | post_code varchar(64) not null comment '岗位编码', |
| | | post_name varchar(50) not null comment '岗位名称', |
| | | post_sort int(4) not null comment '显示顺序', |
| | |
| | | drop table if exists sys_role; |
| | | create table sys_role ( |
| | | role_id bigint(20) not null comment '角色ID', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | role_name varchar(30) not null comment '角色名称', |
| | | role_key varchar(100) not null comment '角色权限字符串', |
| | | role_sort int(4) not null comment '显示顺序', |
| | |
| | | status char(1) not null comment '角色状态(0正常 1停用)', |
| | | del_flag char(1) default '0' comment '删除标志(0代表存在 2代表删除)', |
| | | create_dept bigint(20) default null comment '创建部门', |
| | | create_by varchar(64) default null comment '创建者', |
| | | create_by bigint(20) default null comment '创建者', |
| | | create_time datetime comment '创建时间', |
| | | update_by varchar(64) default null comment '更新者', |
| | | update_by bigint(20) default null comment '更新者', |
| | | update_time datetime comment '更新时间', |
| | | remark varchar(500) default null comment '备注', |
| | | primary key (role_id) |
| | |
| | | insert into sys_menu values('6', '租户管理', '0', '2', 'tenant', null, '', 1, 0, 'M', '0', '0', '', 'chart', 103, 1, sysdate(), null, null, '租户管理目录'); |
| | | insert into sys_menu values('2', '系统监控', '0', '3', 'monitor', null, '', 1, 0, 'M', '0', '0', '', 'monitor', 103, 1, sysdate(), null, null, '系统监控目录'); |
| | | insert into sys_menu values('3', '系统工具', '0', '4', 'tool', null, '', 1, 0, 'M', '0', '0', '', 'tool', 103, 1, sysdate(), null, null, '系统工具目录'); |
| | | insert into sys_menu values('4', 'PLUS官网', '0', '5', 'https://gitee.com/JavaLionLi/RuoYi-Vue-Plus', null, '', 0, 0, 'M', '0', '0', '', 'guide', 103, 1, sysdate(), null, null, 'RuoYi-Vue-Plus官网地址'); |
| | | insert into sys_menu values('4', 'PLUS官网', '0', '5', 'https://gitee.com/dromara/RuoYi-Vue-Plus', null, '', 0, 0, 'M', '0', '0', '', 'guide', 103, 1, sysdate(), null, null, 'RuoYi-Vue-Plus官网地址'); |
| | | -- 二级菜单 |
| | | insert into sys_menu values('100', '用户管理', '1', '1', 'user', 'system/user/index', '', 1, 0, 'C', '0', '0', 'system:user:list', 'user', 103, 1, sysdate(), null, null, '用户管理菜单'); |
| | | insert into sys_menu values('101', '角色管理', '1', '2', 'role', 'system/role/index', '', 1, 0, 'C', '0', '0', 'system:role:list', 'peoples', 103, 1, sysdate(), null, null, '角色管理菜单'); |
| | |
| | | drop table if exists sys_oper_log; |
| | | create table sys_oper_log ( |
| | | oper_id bigint(20) not null comment '日志主键', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | title varchar(50) default '' comment '模块标题', |
| | | business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)', |
| | | method varchar(100) default '' comment '方法名称', |
| | |
| | | status int(1) default 0 comment '操作状态(0正常 1异常)', |
| | | error_msg varchar(2000) default '' comment '错误消息', |
| | | oper_time datetime comment '操作时间', |
| | | primary key (oper_id) |
| | | cost_time bigint(20) default 0 comment '消耗时间', |
| | | primary key (oper_id), |
| | | key idx_sys_oper_log_bt (business_type), |
| | | key idx_sys_oper_log_s (status), |
| | | key idx_sys_oper_log_ot (oper_time) |
| | | ) engine=innodb comment = '操作日志记录'; |
| | | |
| | | |
| | |
| | | create table sys_dict_type |
| | | ( |
| | | dict_id bigint(20) not null comment '字典主键', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | dict_name varchar(100) default '' comment '字典名称', |
| | | dict_type varchar(100) default '' comment '字典类型', |
| | | status char(1) default '0' comment '状态(0正常 1停用)', |
| | | create_dept bigint(20) default null comment '创建部门', |
| | | create_by varchar(64) default null comment '创建者', |
| | | create_by bigint(20) default null comment '创建者', |
| | | create_time datetime comment '创建时间', |
| | | update_by varchar(64) default null comment '更新者', |
| | | update_by bigint(20) default null comment '更新者', |
| | | update_time datetime comment '更新时间', |
| | | remark varchar(500) default null comment '备注', |
| | | primary key (dict_id), |
| | |
| | | create table sys_dict_data |
| | | ( |
| | | dict_code bigint(20) not null comment '字典编码', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | dict_sort int(4) default 0 comment '字典排序', |
| | | dict_label varchar(100) default '' comment '字典标签', |
| | | dict_value varchar(100) default '' comment '字典键值', |
| | |
| | | is_default char(1) default 'N' comment '是否默认(Y是 N否)', |
| | | status char(1) default '0' comment '状态(0正常 1停用)', |
| | | create_dept bigint(20) default null comment '创建部门', |
| | | create_by varchar(64) default null comment '创建者', |
| | | create_by bigint(20) default null comment '创建者', |
| | | create_time datetime comment '创建时间', |
| | | update_by varchar(64) default null comment '更新者', |
| | | update_by bigint(20) default null comment '更新者', |
| | | update_time datetime comment '更新时间', |
| | | remark varchar(500) default null comment '备注', |
| | | primary key (dict_code) |
| | |
| | | drop table if exists sys_config; |
| | | create table sys_config ( |
| | | config_id bigint(20) not null comment '参数主键', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | config_name varchar(100) default '' comment '参数名称', |
| | | config_key varchar(100) default '' comment '参数键名', |
| | | config_value varchar(500) default '' comment '参数键值', |
| | |
| | | primary key (config_id) |
| | | ) engine=innodb comment = '参数配置表'; |
| | | |
| | | insert into sys_config values(1, '000000', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, sysdate(), null, null, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow' ); |
| | | insert into sys_config values(2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, sysdate(), null, null, '初始化密码 123456' ); |
| | | insert into sys_config values(3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, sysdate(), null, null, '深色主题theme-dark,浅色主题theme-light' ); |
| | | insert into sys_config values(5, '000000', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'false', 'Y', 103, 1, sysdate(), null, null, '是否开启注册用户功能(true开启,false关闭)'); |
| | | insert into sys_config values(11, '000000', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, sysdate(), null, null, 'true:开启, false:关闭'); |
| | | |
| | | insert into sys_config values(1, '000000', '主框架页-默认皮肤样式名称', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, sysdate(), null, NULL, '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow'); |
| | | insert into sys_config values(2, '000000', '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', 103, 1, sysdate(), null, NULL, '初始化密码 123456'); |
| | | insert into sys_config values(3, '000000', '主框架页-侧边栏主题', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, sysdate(), null, NULL, '深色主题theme-dark,浅色主题theme-light'); |
| | | insert into sys_config values(4, '000000', '账号自助-验证码开关', 'sys.account.captchaEnabled', 'true', 'Y', 103, 1, sysdate(), null, NULL, '是否开启验证码功能(true开启,false关闭)'); |
| | | insert into sys_config values(5, '000000', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', 'true', 'Y', 103, 1, sysdate(), null, NULL, '是否开启注册用户功能(true开启,false关闭)'); |
| | | insert into sys_config values(6, '000000', '用户配置-密码最大错误次数', 'sys.user.maxRetryCount', '5', 'Y', 103, 1, sysdate(), null, NULL, '密码最大错误次数'); |
| | | insert into sys_config values(7, '000000', '用户配置-密码锁定时间', 'sys.user.lockTime', '10', 'Y', 103, 1, sysdate(), null, NULL, '密码锁定时间(分钟)'); |
| | | insert into sys_config values(8, '000000', '账号自助-短信开关', 'sys.account.smsEnabled', 'false', 'Y', 103, 1, sysdate(), null, NULL, '是否开启短信功能(true开启,false关闭)'); |
| | | insert into sys_config values(9, '000000', '账号自助-验证码模板id', 'sys.account.templateId', '', 'Y', 103, 1, sysdate(), null, NULL, '验证码模板id'); |
| | | insert into sys_config values(11,'000000', 'OSS预览列表资源开关', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, sysdate(), null, NULL, 'true:开启, false:关闭'); |
| | | |
| | | -- ---------------------------- |
| | | -- 14、系统访问记录 |
| | |
| | | drop table if exists sys_logininfor; |
| | | create table sys_logininfor ( |
| | | info_id bigint(20) not null comment '访问ID', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | user_name varchar(50) default '' comment '用户账号', |
| | | ipaddr varchar(128) default '' comment '登录IP地址', |
| | | login_location varchar(255) default '' comment '登录地点', |
| | |
| | | status char(1) default '0' comment '登录状态(0成功 1失败)', |
| | | msg varchar(255) default '' comment '提示消息', |
| | | login_time datetime comment '访问时间', |
| | | primary key (info_id) |
| | | primary key (info_id), |
| | | key idx_sys_logininfor_s (status), |
| | | key idx_sys_logininfor_lt (login_time) |
| | | ) engine=innodb comment = '系统访问记录'; |
| | | |
| | | |
| | |
| | | drop table if exists sys_notice; |
| | | create table sys_notice ( |
| | | notice_id bigint(20) not null comment '公告ID', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | notice_title varchar(50) not null comment '公告标题', |
| | | notice_type char(1) not null comment '公告类型(1通知 2公告)', |
| | | notice_content longblob default null comment '公告内容', |
| | |
| | | drop table if exists sys_oss; |
| | | create table sys_oss ( |
| | | oss_id bigint(20) not null comment '对象存储主键', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | | file_name varchar(255) not null default '' comment '文件名', |
| | | original_name varchar(255) not null default '' comment '原名', |
| | | file_suffix varchar(10) not null default '' comment '文件后缀名', |
| | |
| | | drop table if exists sys_oss_config; |
| | | create table sys_oss_config ( |
| | | oss_config_id bigint(20) not null comment '主建', |
| | | tenant_id varchar(20) not null comment '租户编号', |
| | | tenant_id varchar(20) default '000000'comment '租户编号', |
| | | config_key varchar(20) not null default '' comment '配置key', |
| | | access_key varchar(255) default '' comment 'accessKey', |
| | | secret_key varchar(255) default '' comment '秘钥', |
| | |
| | | is_https char(1) default 'N' comment '是否https(Y=是,N=否)', |
| | | region varchar(255) default '' comment '域', |
| | | access_policy char(1) not null default '1' comment '桶权限类型(0=private 1=public 2=custom)', |
| | | status char(1) default '1' comment '状态(0=正常,1=停用)', |
| | | status char(1) default '1' comment '是否默认(0=是,1=否)', |
| | | ext1 varchar(255) default '' comment '扩展字段', |
| | | create_dept bigint(20) default null comment '创建部门', |
| | | create_by bigint(20) default null comment '创建者', |
| | | create_time datetime default null comment '创建时间', |
| | | update_by bigint(20) default null comment '更新者', |
| | | update_time datetime default null comment '更新时间', |
| | | remark varchar(500) default null comment '备注', |
| | | remark varchar(500) default null comment '备注', |
| | | primary key (oss_config_id) |
| | | ) engine=innodb comment='对象存储配置表'; |
| | | |