From c82bde97920aefc0a4f6eed6eadce9faa0882b2f Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期一, 13 三月 2023 23:41:16 +0800 Subject: [PATCH] fix 修复 关闭租户后 插入数据报无租户ID问题 使用默认值兼容 --- script/sql/postgres/postgres_ry_vue_5.X.sql | 24 ++++++------ script/sql/ry_vue_5.X.sql | 24 ++++++------ script/sql/oracle/oracle_ry_vue_5.X.sql | 24 ++++++------ script/sql/sqlserver/sqlserver_ry_vue_5.X.sql | 46 +++++++++++----------- 4 files changed, 59 insertions(+), 59 deletions(-) diff --git a/script/sql/oracle/oracle_ry_vue_5.X.sql b/script/sql/oracle/oracle_ry_vue_5.X.sql index 067122a..16a0ea4 100644 --- a/script/sql/oracle/oracle_ry_vue_5.X.sql +++ b/script/sql/oracle/oracle_ry_vue_5.X.sql @@ -92,7 +92,7 @@ -- ---------------------------- create table sys_dept ( dept_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', parent_id number(20) default 0, ancestors varchar2(500) default '', dept_name varchar2(30) default '', @@ -149,7 +149,7 @@ -- ---------------------------- create table sys_user ( user_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', dept_id number(20) default null, user_name varchar2(40) not null, nick_name varchar2(40) not null, @@ -208,7 +208,7 @@ -- ---------------------------- create table sys_post ( post_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', post_code varchar2(64) not null, post_name varchar2(50) not null, post_sort number(4) not null, @@ -251,7 +251,7 @@ -- ---------------------------- create table sys_role ( role_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', role_name varchar2(30) not null, role_key varchar2(100) not null, role_sort number(4) not null, @@ -634,7 +634,7 @@ -- ---------------------------- create table sys_oper_log ( oper_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', title varchar2(50) default '', business_type number(2) default 0, method varchar2(100) default '', @@ -684,7 +684,7 @@ -- ---------------------------- create table sys_dict_type ( dict_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', dict_name varchar2(100) default '', dict_type varchar2(100) default '', status char(1) default '0', @@ -727,7 +727,7 @@ -- ---------------------------- create table sys_dict_data ( dict_code number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', dict_sort number(4) default 0, dict_label varchar2(100) default '', dict_value varchar2(100) default '', @@ -796,7 +796,7 @@ -- ---------------------------- create table sys_config ( config_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', config_name varchar2(100) default '', config_key varchar2(100) default '', config_value varchar2(100) default '', @@ -836,7 +836,7 @@ -- ---------------------------- create table sys_logininfor ( info_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', user_name varchar2(50) default '', ipaddr varchar2(128) default '', login_location varchar2(255) default '', @@ -869,7 +869,7 @@ -- ---------------------------- create table sys_notice ( notice_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', notice_title varchar2(50) not null, notice_type char(1) not null, notice_content clob default null, @@ -1020,7 +1020,7 @@ -- ---------------------------- create table sys_oss ( oss_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', file_name varchar(255) not null, original_name varchar(255) not null, file_suffix varchar(10) not null, @@ -1055,7 +1055,7 @@ -- ---------------------------- create table sys_oss_config ( oss_config_id number(20) not null, - tenant_id varchar2(20) not null, + tenant_id varchar2(20) default '000000', config_key varchar(20) not null, access_key varchar(255) default '', secret_key varchar(255) default '', diff --git a/script/sql/postgres/postgres_ry_vue_5.X.sql b/script/sql/postgres/postgres_ry_vue_5.X.sql index 65857bf..dac6d1e 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, @@ -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, @@ -702,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, @@ -747,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, @@ -817,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, @@ -859,7 +859,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, @@ -893,7 +893,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, @@ -1045,7 +1045,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, @@ -1080,7 +1080,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, diff --git a/script/sql/ry_vue_5.X.sql b/script/sql/ry_vue_5.X.sql index 430e882..8232cbd 100644 --- a/script/sql/ry_vue_5.X.sql +++ b/script/sql/ry_vue_5.X.sql @@ -62,7 +62,7 @@ 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 '鐖堕儴闂╥d', ancestors varchar(500) default '' comment '绁栫骇鍒楄〃', dept_name varchar(30) default '' comment '閮ㄩ棬鍚嶇О', @@ -103,7 +103,7 @@ 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 '鐢ㄦ埛鏄电О', @@ -140,7 +140,7 @@ 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 '鏄剧ず椤哄簭', @@ -169,7 +169,7 @@ 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 '鏄剧ず椤哄簭', @@ -498,7 +498,7 @@ 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 '鏂规硶鍚嶇О', @@ -529,7 +529,7 @@ 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姝e父 1鍋滅敤锛�', @@ -560,7 +560,7 @@ 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 '瀛楀吀閿��', @@ -611,7 +611,7 @@ 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 '鍙傛暟閿��', @@ -638,7 +638,7 @@ 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 '鐧诲綍鍦扮偣', @@ -659,7 +659,7 @@ 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 '鍏憡鍐呭', @@ -747,7 +747,7 @@ 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 '鏂囦欢鍚庣紑鍚�', @@ -767,7 +767,7 @@ 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 '绉橀挜', diff --git a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql index a4caa0c..871697e 100644 --- a/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql +++ b/script/sql/sqlserver/sqlserver_ry_vue_5.X.sql @@ -592,7 +592,7 @@ CREATE TABLE sys_config ( config_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT '000000' NULL, config_name nvarchar(100) DEFAULT '' NULL, config_key nvarchar(100) DEFAULT '' NULL, config_value nvarchar(500) DEFAULT '' NULL, @@ -702,7 +702,7 @@ CREATE TABLE sys_dept ( dept_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, parent_id bigint DEFAULT ((0)) NULL, ancestors nvarchar(500)DEFAULT '' NULL, dept_name nvarchar(30) DEFAULT '' NULL, @@ -850,7 +850,7 @@ CREATE TABLE sys_dict_data ( dict_code bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, dict_sort int DEFAULT ((0)) NULL, dict_label nvarchar(100) DEFAULT '' NULL, dict_value nvarchar(100) DEFAULT '' NULL, @@ -1036,7 +1036,7 @@ CREATE TABLE sys_dict_type ( dict_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, dict_name nvarchar(100) DEFAULT '' NULL, dict_type nvarchar(100) DEFAULT '' NULL, status nchar(1) DEFAULT ('0') NULL, @@ -1152,7 +1152,7 @@ CREATE TABLE sys_logininfor ( info_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, user_name nvarchar(50) DEFAULT '' NULL, ipaddr nvarchar(128) DEFAULT '' NULL, login_location nvarchar(255) DEFAULT '' NULL, @@ -1591,7 +1591,7 @@ CREATE TABLE sys_notice ( notice_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, notice_title nvarchar(50) NOT NULL, notice_type nchar(1) NOT NULL, notice_content nvarchar(max) NULL, @@ -1696,7 +1696,7 @@ CREATE TABLE sys_oper_log ( oper_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, title nvarchar(50) DEFAULT '' NULL, business_type int DEFAULT ((0)) NULL, method nvarchar(100) DEFAULT '' NULL, @@ -1843,18 +1843,18 @@ CREATE TABLE sys_post ( - post_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, - post_code nvarchar(64) NOT NULL, - post_name nvarchar(50) NOT NULL, - post_sort int NOT NULL, - status nchar(1) NOT NULL, - create_dept bigint NULL, - create_by bigint NULL, - create_time datetime2(7) NULL, - update_by bigint NULL, - update_time datetime2(7) NULL, - remark nvarchar(500) NULL, + post_id bigint NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, + post_code nvarchar(64) NOT NULL, + post_name nvarchar(50) NOT NULL, + post_sort int NOT NULL, + status nchar(1) NOT NULL, + create_dept bigint NULL, + create_by bigint NULL, + create_time datetime2(7) NULL, + update_by bigint NULL, + update_time datetime2(7) NULL, + remark nvarchar(500) NULL, CONSTRAINT PK__sys_post__3ED7876668E2D081 PRIMARY KEY CLUSTERED (post_id) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] @@ -1952,7 +1952,7 @@ CREATE TABLE sys_role ( role_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, role_name nvarchar(30) NOT NULL, role_key nvarchar(100) NOT NULL, role_sort int NOT NULL, @@ -2314,7 +2314,7 @@ CREATE TABLE sys_user ( user_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, dept_id bigint NULL, user_name nvarchar(30) NOT NULL, nick_name nvarchar(30) NOT NULL, @@ -2549,7 +2549,7 @@ CREATE TABLE sys_oss ( oss_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, file_name nvarchar(255) DEFAULT '' NOT NULL, original_name nvarchar(255) DEFAULT '' NOT NULL, file_suffix nvarchar(10) DEFAULT '' NOT NULL, @@ -2648,7 +2648,7 @@ CREATE TABLE sys_oss_config ( oss_config_id bigint NOT NULL, - tenant_id nvarchar(20) NOT NULL, + tenant_id nvarchar(20) DEFAULT ('000000') NULL, config_key nvarchar(20) DEFAULT '' NOT NULL, access_key nvarchar(255) DEFAULT '' NULL, secret_key nvarchar(255) DEFAULT '' NULL, -- Gitblit v1.9.3