fix 修复 关闭租户后 插入数据报无租户ID问题 使用默认值兼容
| | |
| | | -- ---------------------------- |
| | | 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 '', |
| | |
| | | -- ---------------------------- |
| | | 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, |
| | |
| | | -- ---------------------------- |
| | | 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, |
| | |
| | | -- ---------------------------- |
| | | 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, |
| | |
| | | -- ---------------------------- |
| | | 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 '', |
| | |
| | | -- ---------------------------- |
| | | 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', |
| | |
| | | -- ---------------------------- |
| | | 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 '', |
| | |
| | | -- ---------------------------- |
| | | 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 '', |
| | |
| | | -- ---------------------------- |
| | | 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 '', |
| | |
| | | -- ---------------------------- |
| | | 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, |
| | |
| | | -- ---------------------------- |
| | | 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, |
| | |
| | | -- ---------------------------- |
| | | 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 '', |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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 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, |
| | |
| | | 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 '显示顺序', |
| | |
| | | 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 '方法名称', |
| | |
| | | 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 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 '字典键值', |
| | |
| | | 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 '参数键值', |
| | |
| | | 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 '登录地点', |
| | |
| | | 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 '秘钥', |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | |
| | | 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] |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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, |