| | |
| | | create table if not exists sys_dept |
| | | ( |
| | | dept_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | parent_id int8 default 0, |
| | | ancestors varchar(500)default ''::varchar, |
| | | dept_name varchar(30) default ''::varchar, |
| | |
| | | create table if not exists sys_user |
| | | ( |
| | | user_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | dept_id int8, |
| | | user_name varchar(30) not null, |
| | | nick_name varchar(30) not null, |
| | |
| | | create table if not exists sys_post |
| | | ( |
| | | post_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | post_code varchar(64) not null, |
| | | post_name varchar(50) not null, |
| | | post_sort int4 not null, |
| | |
| | | create table if not exists sys_role |
| | | ( |
| | | role_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | role_name varchar(30) not null, |
| | | role_key varchar(100) not null, |
| | | role_sort int4 not null, |
| | |
| | | insert into sys_menu values('6', '系统管理', '0', '2', 'tenant', null, '', '1', '0', 'M', '0', '0', '', 'chart', 103, 1, now(), null, null, '租户管理目录'); |
| | | insert into sys_menu values('2', '系统监控', '0', '3', 'monitor', null, '', '1', '0', 'M', '0', '0', '', 'monitor', 103, 1, now(), null, null, '系统监控目录'); |
| | | insert into sys_menu values('3', '系统工具', '0', '4', 'tool', null, '', '1', '0', 'M', '0', '0', '', 'tool', 103, 1, now(), 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, now(), 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, now(), 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, now(), 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, now(), null, null, '角色管理菜单'); |
| | |
| | | insert into sys_menu values('117', 'Admin监控', '2', '5', 'Admin', 'monitor/admin/index', '', '1', '0', 'C', '0', '0', 'monitor:admin:list', 'dashboard', 103, 1, now(), null, null, 'Admin监控菜单'); |
| | | -- oss菜单 |
| | | insert into sys_menu values('118', '文件管理', '1', '10', 'oss', 'system/oss/index', '', '1', '0', 'C', '0', '0', 'system:oss:list', 'upload', 103, 1, now(), null, null, '文件管理菜单'); |
| | | -- xxl-job-admin控制台 |
| | | insert into sys_menu values('120', '任务调度中心', '2', '5', 'XxlJob', 'monitor/xxljob/index', '', '1', '0', 'C', '0', '0', 'monitor:xxljob:list', 'job', 103, 1, now(), null, null, 'Xxl-Job控制台菜单'); |
| | | -- powerjob server控制台 |
| | | insert into sys_menu values('120', '任务调度中心', '2', '5', 'powerjob', 'monitor/powerjob/index', '', '1', '0', 'C', '0', '0', 'monitor:powerjob:list', 'job', 103, 1, now(), null, null, 'PowerJob控制台菜单'); |
| | | |
| | | -- 三级菜单 |
| | | insert into sys_menu values('500', '操作日志', '108', '1', 'operlog', 'monitor/operlog/index', '', '1', '0', 'C', '0', '0', 'monitor:operlog:list', 'form', 103, 1, now(), null, null, '操作日志菜单'); |
| | |
| | | create table if not exists sys_oper_log |
| | | ( |
| | | oper_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | title varchar(50) default ''::varchar, |
| | | business_type int4 default 0, |
| | | method varchar(100) default ''::varchar, |
| | |
| | | status int4 default 0, |
| | | error_msg varchar(2000) default ''::varchar, |
| | | oper_time timestamp, |
| | | cost_time int8 default 0, |
| | | constraint sys_oper_log_pk primary key (oper_id) |
| | | ); |
| | | |
| | | create index idx_sys_oper_log_bt ON sys_oper_log (business_type); |
| | | create index idx_sys_oper_log_s ON sys_oper_log (status); |
| | | create index idx_sys_oper_log_ot ON sys_oper_log (oper_time); |
| | | |
| | | comment on table sys_oper_log is '操作日志记录'; |
| | | comment on column sys_oper_log.oper_id is '日志主键'; |
| | |
| | | comment on column sys_oper_log.status is '操作状态(0正常 1异常)'; |
| | | comment on column sys_oper_log.error_msg is '错误消息'; |
| | | comment on column sys_oper_log.oper_time is '操作时间'; |
| | | comment on column sys_oper_log.cost_time is '消耗时间'; |
| | | |
| | | -- ---------------------------- |
| | | -- 11、字典类型表 |
| | |
| | | create table if not exists sys_dict_type |
| | | ( |
| | | dict_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | dict_name varchar(100) default ''::varchar, |
| | | dict_type varchar(100) default ''::varchar, |
| | | status char default '0'::bpchar, |
| | |
| | | constraint sys_dict_type_pk primary key (dict_id) |
| | | ); |
| | | |
| | | CREATE UNIQUE INDEX sys_dict_type_index1 ON sys_dict_type (tenant_id, dict_type); |
| | | create unique index sys_dict_type_index1 ON sys_dict_type (tenant_id, dict_type); |
| | | |
| | | comment on table sys_dict_type is '字典类型表'; |
| | | comment on column sys_dict_type.dict_id is '字典主键'; |
| | |
| | | create table if not exists sys_dict_data |
| | | ( |
| | | dict_code int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | dict_sort int4 default 0, |
| | | dict_label varchar(100) default ''::varchar, |
| | | dict_value varchar(100) default ''::varchar, |
| | |
| | | create table if not exists sys_config |
| | | ( |
| | | config_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | config_name varchar(100) default ''::varchar, |
| | | config_key varchar(100) default ''::varchar, |
| | | config_value varchar(500) default ''::varchar, |
| | |
| | | create table if not exists sys_logininfor |
| | | ( |
| | | info_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | user_name varchar(50) default ''::varchar, |
| | | ipaddr varchar(128) default ''::varchar, |
| | | login_location varchar(255) default ''::varchar, |
| | |
| | | login_time timestamp, |
| | | constraint sys_logininfor_pk primary key (info_id) |
| | | ); |
| | | |
| | | create index idx_sys_logininfor_s ON sys_logininfor (status); |
| | | create index idx_sys_logininfor_lt ON sys_logininfor (login_time); |
| | | |
| | | comment on table sys_logininfor is '系统访问记录'; |
| | | comment on column sys_logininfor.info_id is '访问ID'; |
| | |
| | | create table if not exists sys_notice |
| | | ( |
| | | notice_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | notice_title varchar(50) not null, |
| | | notice_type char not null, |
| | | notice_content text, |
| | |
| | | create table if not exists gen_table |
| | | ( |
| | | table_id int8, |
| | | data_name varchar(200) default ''::varchar, |
| | | table_name varchar(200) default ''::varchar, |
| | | table_comment varchar(500) default ''::varchar, |
| | | sub_table_name varchar(64) default ''::varchar, |
| | |
| | | gen_type char default '0'::bpchar not null, |
| | | gen_path varchar(200) default '/'::varchar, |
| | | options varchar(1000) default null::varchar, |
| | | create_dept int8, |
| | | create_by int8, |
| | | create_time timestamp, |
| | | update_by int8, |
| | |
| | | |
| | | comment on table gen_table is '代码生成业务表'; |
| | | comment on column gen_table.table_id is '编号'; |
| | | comment on column gen_table.data_name is '数据源名称'; |
| | | comment on column gen_table.table_name is '表名称'; |
| | | comment on column gen_table.table_comment is '表描述'; |
| | | comment on column gen_table.sub_table_name is '关联子表的表名'; |
| | |
| | | create table if not exists sys_oss |
| | | ( |
| | | oss_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | file_name varchar(255) default ''::varchar not null, |
| | | original_name varchar(255) default ''::varchar not null, |
| | | file_suffix varchar(10) default ''::varchar not null, |
| | |
| | | create table if not exists sys_oss_config |
| | | ( |
| | | oss_config_id int8, |
| | | tenant_id varchar(20) not null, |
| | | tenant_id varchar(20) default '000000'::varchar, |
| | | config_key varchar(20) default ''::varchar not null, |
| | | access_key varchar(255) default ''::varchar, |
| | | secret_key varchar(255) default ''::varchar, |
| | |
| | | comment on column sys_oss_config.is_https is '是否https(Y=是,N=否)'; |
| | | comment on column sys_oss_config.region is '域'; |
| | | comment on column sys_oss_config.access_policy is '桶权限类型(0=private 1=public 2=custom)'; |
| | | comment on column sys_oss_config.status is '状态(0=正常,1=停用)'; |
| | | comment on column sys_oss_config.status is '是否默认(0=是,1=否)'; |
| | | comment on column sys_oss_config.ext1 is '扩展字段'; |
| | | comment on column sys_oss_config.create_dept is '创建部门'; |
| | | comment on column sys_oss_config.create_by is '创建者'; |