| | |
| | | -- ---------------------------- |
| | | -- 第三方平台授权表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_social; |
| | | create table sys_social |
| | | ( |
| | | id bigint not null comment '主键', |
| | |
| | | -- ---------------------------- |
| | | -- 租户表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_tenant; |
| | | create table sys_tenant |
| | | ( |
| | | id bigint(20) not null comment 'id', |
| | |
| | | -- ---------------------------- |
| | | -- 租户套餐表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_tenant_package; |
| | | create table sys_tenant_package ( |
| | | package_id bigint(20) not null comment '租户套餐id', |
| | | package_name varchar(20) comment '套餐名称', |
| | |
| | | -- ---------------------------- |
| | | -- 1、部门表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_dept; |
| | | create table sys_dept ( |
| | | dept_id bigint(20) not null comment '部门id', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | |
| | | -- ---------------------------- |
| | | -- 2、用户信息表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_user; |
| | | create table sys_user ( |
| | | user_id bigint(20) not null comment '用户ID', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | |
| | | -- ---------------------------- |
| | | -- 3、岗位信息表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_post; |
| | | create table sys_post |
| | | ( |
| | | post_id bigint(20) not null comment '岗位ID', |
| | |
| | | -- ---------------------------- |
| | | -- 4、角色信息表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_role; |
| | | create table sys_role ( |
| | | role_id bigint(20) not null comment '角色ID', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | |
| | | -- ---------------------------- |
| | | -- 5、菜单权限表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_menu; |
| | | create table sys_menu ( |
| | | menu_id bigint(20) not null comment '菜单ID', |
| | | menu_name varchar(50) not null comment '菜单名称', |
| | |
| | | -- ---------------------------- |
| | | -- 6、用户和角色关联表 用户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', |
| | |
| | | -- ---------------------------- |
| | | -- 7、角色和菜单关联表 角色1-N菜单 |
| | | -- ---------------------------- |
| | | drop table if exists sys_role_menu; |
| | | create table sys_role_menu ( |
| | | role_id bigint(20) not null comment '角色ID', |
| | | menu_id bigint(20) not null comment '菜单ID', |
| | |
| | | -- ---------------------------- |
| | | -- 8、角色和部门关联表 角色1-N部门 |
| | | -- ---------------------------- |
| | | drop table if exists sys_role_dept; |
| | | create table sys_role_dept ( |
| | | role_id bigint(20) not null comment '角色ID', |
| | | dept_id bigint(20) not null comment '部门ID', |
| | |
| | | -- ---------------------------- |
| | | -- 9、用户与岗位关联表 用户1-N岗位 |
| | | -- ---------------------------- |
| | | drop table if exists sys_user_post; |
| | | create table sys_user_post |
| | | ( |
| | | user_id bigint(20) not null comment '用户ID', |
| | |
| | | -- ---------------------------- |
| | | -- 10、操作日志记录 |
| | | -- ---------------------------- |
| | | drop table if exists sys_oper_log; |
| | | create table sys_oper_log ( |
| | | oper_id bigint(20) not null comment '日志主键', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | |
| | | -- ---------------------------- |
| | | -- 11、字典类型表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_dict_type; |
| | | create table sys_dict_type |
| | | ( |
| | | dict_id bigint(20) not null comment '字典主键', |
| | |
| | | -- ---------------------------- |
| | | -- 12、字典数据表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_dict_data; |
| | | create table sys_dict_data |
| | | ( |
| | | dict_code bigint(20) not null comment '字典编码', |
| | |
| | | -- ---------------------------- |
| | | -- 13、参数配置表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_config; |
| | | create table sys_config ( |
| | | config_id bigint(20) not null comment '参数主键', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | |
| | | -- ---------------------------- |
| | | -- 14、系统访问记录 |
| | | -- ---------------------------- |
| | | drop table if exists sys_logininfor; |
| | | create table sys_logininfor ( |
| | | info_id bigint(20) not null comment '访问ID', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | |
| | | -- ---------------------------- |
| | | -- 17、通知公告表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_notice; |
| | | create table sys_notice ( |
| | | notice_id bigint(20) not null comment '公告ID', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | |
| | | -- ---------------------------- |
| | | -- 18、代码生成业务表 |
| | | -- ---------------------------- |
| | | drop table if exists gen_table; |
| | | create table gen_table ( |
| | | table_id bigint(20) not null comment '编号', |
| | | data_name varchar(200) default '' comment '数据源名称', |
| | |
| | | -- ---------------------------- |
| | | -- 19、代码生成业务表字段 |
| | | -- ---------------------------- |
| | | drop table if exists gen_table_column; |
| | | create table gen_table_column ( |
| | | column_id bigint(20) not null comment '编号', |
| | | table_id bigint(20) comment '归属表编号', |
| | |
| | | -- ---------------------------- |
| | | -- OSS对象存储表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_oss; |
| | | create table sys_oss ( |
| | | oss_id bigint(20) not null comment '对象存储主键', |
| | | tenant_id varchar(20) default '000000' comment '租户编号', |
| | |
| | | -- ---------------------------- |
| | | -- OSS对象存储动态配置表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_oss_config; |
| | | create table sys_oss_config ( |
| | | oss_config_id bigint(20) not null comment '主建', |
| | | tenant_id varchar(20) default '000000'comment '租户编号', |
| | |
| | | -- ---------------------------- |
| | | -- 系统授权表 |
| | | -- ---------------------------- |
| | | drop table if exists sys_client; |
| | | create table sys_client ( |
| | | id bigint(20) not null comment 'id', |
| | | client_id varchar(64) default null comment '客户端id', |