From 1ed1752f678f769e43e9faa34809701850c7f727 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期四, 30 三月 2023 19:14:38 +0800 Subject: [PATCH] update 优化 验证码有效期 迁移到数据库 参数管理内 --- script/sql/postgres/postgres_ry_vue_5.X.sql | 46 +++++++++++++++++++++++++++++++--------------- 1 files changed, 31 insertions(+), 15 deletions(-) diff --git a/script/sql/postgres/postgres_ry_vue_5.X.sql b/script/sql/postgres/postgres_ry_vue_5.X.sql index 4ad90df..037b1b2 100644 --- a/script/sql/postgres/postgres_ry_vue_5.X.sql +++ b/script/sql/postgres/postgres_ry_vue_5.X.sql @@ -100,7 +100,7 @@ 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, @@ -157,7 +157,7 @@ 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, @@ -218,7 +218,7 @@ 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, @@ -261,7 +261,7 @@ 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, @@ -363,7 +363,7 @@ 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, '瑙掕壊绠$悊鑿滃崟'); @@ -651,7 +651,7 @@ 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, @@ -667,8 +667,13 @@ 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 unique index idx_sys_oper_log_bt ON sys_oper_log (business_type); +create unique index idx_sys_oper_log_s ON sys_oper_log (status); +create unique 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 '鏃ュ織涓婚敭'; @@ -688,6 +693,7 @@ comment on column sys_oper_log.status is '鎿嶄綔鐘舵�侊紙0姝e父 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銆佸瓧鍏哥被鍨嬭〃 @@ -696,7 +702,7 @@ 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, @@ -709,7 +715,7 @@ 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 '瀛楀吀涓婚敭'; @@ -741,7 +747,7 @@ 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, @@ -811,7 +817,7 @@ 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, @@ -842,7 +848,13 @@ insert into sys_config values(1, '000000', '涓绘鏋堕〉-榛樿鐨偆鏍峰紡鍚嶇О', 'sys.index.skinName', 'skin-blue', 'Y', 103, 1, now(), 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, now(), null, null, '鍒濆鍖栧瘑鐮� 123456' ); insert into sys_config values(3, '000000', '涓绘鏋堕〉-渚ц竟鏍忎富棰�', 'sys.index.sideTheme', 'theme-dark', 'Y', 103, 1, now(), null, null, '娣辫壊涓婚theme-dark锛屾祬鑹蹭富棰榯heme-light' ); +insert into sys_config values(4, '000000', '鐢ㄦ埛閰嶇疆-楠岃瘉鐮佹湁鏁堟湡', 'sys.account.captchaExpired', '2', 'Y', 103, 1, now(), null, NULL, '楠岃瘉鐮佹湁鏁堟湡锛堝垎閽燂級'); insert into sys_config values(5, '000000', '璐﹀彿鑷姪-鏄惁寮�鍚敤鎴锋敞鍐屽姛鑳�', 'sys.account.registerUser', 'false', 'Y', 103, 1, now(), null, null, '鏄惁寮�鍚敞鍐岀敤鎴峰姛鑳斤紙true寮�鍚紝false鍏抽棴锛�'); +insert into sys_config values(6, '000000', '鐢ㄦ埛閰嶇疆-瀵嗙爜鏈�澶ч敊璇鏁�', 'sys.user.maxRetryCount', '5', 'Y', 103, 1,now(), null, null, '瀵嗙爜鏈�澶ч敊璇鏁�'); +insert into sys_config values(7, '000000', '鐢ㄦ埛閰嶇疆-瀵嗙爜閿佸畾鏃堕棿', 'sys.user.lockTime', '10', 'Y', 103, 1, now(), null, null, '瀵嗙爜閿佸畾鏃堕棿锛堝垎閽燂級'); +insert into sys_config values(8, '000000', '璐﹀彿鑷姪-鐭俊寮�鍏�', 'sys.account.smsEnabled', 'false', 'Y', 103, 1, now(), null, null, '鏄惁寮�鍚煭淇″姛鑳斤紙true寮�鍚紝false鍏抽棴锛�'); +insert into sys_config values(9, '000000', '璐﹀彿鑷姪-楠岃瘉鐮佹ā鏉縤d', 'sys.account.templateId', '', 'Y', 103, 1, now(), null, null, '楠岃瘉鐮佹ā鏉縤d'); +insert into sys_config values(10, '000000', '璐﹀彿鑷姪-閭欢寮�鍏�', 'sys.account.emailEnabled', 'false', 'Y', 103, 1, now(), null, NULL, '鏄惁寮�鍚偖浠跺姛鑳斤紙true寮�鍚紝false鍏抽棴锛�'); insert into sys_config values(11, '000000', 'OSS棰勮鍒楄〃璧勬簮寮�鍏�', 'sys.oss.previewListResource', 'true', 'Y', 103, 1, now(), null, null, 'true:寮�鍚�, false:鍏抽棴'); @@ -853,7 +865,7 @@ 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, @@ -864,6 +876,9 @@ login_time timestamp, constraint sys_logininfor_pk primary key (info_id) ); + +create unique index idx_sys_logininfor_s ON sys_logininfor (status); +create unique 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'; @@ -884,7 +899,7 @@ 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, @@ -940,6 +955,7 @@ 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, @@ -1035,7 +1051,7 @@ 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, @@ -1070,7 +1086,7 @@ 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, @@ -1105,7 +1121,7 @@ comment on column sys_oss_config.is_https is '鏄惁https锛圷=鏄�,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=姝e父,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 '鍒涘缓鑰�'; -- Gitblit v1.9.3