From df2c137fe2d92132948970eb6a984a3466f0d727 Mon Sep 17 00:00:00 2001 From: dengxiaobing <657563945@qq.com> Date: Fri, 30 Dec 2022 10:04:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20sql=20=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/mysql/ruoyi-vue-pro.sql | 4 +- sql/postgresql/ruoyi-vue-pro.sql | 4 +- sql/sqlserver/ruoyi-vue-pro.sql | 4 +- .../src/test/resources/sql/clean.sql | 6 +- .../src/test/resources/sql/create_tables.sql | 13 ----- .../src/test/resources/sql/clean.sql | 5 +- .../src/test/resources/sql/create_tables.sql | 1 - .../src/test/resources/sql/create_tables.sql | 13 ----- .../src/test/resources/sql/clean.sql | 5 +- .../src/test/resources/sql/create_tables.sql | 58 ------------------- 10 files changed, 15 insertions(+), 98 deletions(-) diff --git a/sql/mysql/ruoyi-vue-pro.sql b/sql/mysql/ruoyi-vue-pro.sql index 39cb52afe..be1aa16eb 100644 --- a/sql/mysql/ruoyi-vue-pro.sql +++ b/sql/mysql/ruoyi-vue-pro.sql @@ -2463,7 +2463,7 @@ CREATE TABLE `system_tenant` ( `package_id` bigint NOT NULL COMMENT '租户套餐编号', `expire_time` datetime NOT NULL COMMENT '过期时间', `account_count` int NOT NULL COMMENT '账号数量', - `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建者', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', @@ -2490,7 +2490,7 @@ CREATE TABLE `system_tenant_package` ( `status` tinyint NOT NULL DEFAULT 0 COMMENT '租户状态(0正常 1停用)', `remark` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '备注', `menu_ids` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '关联的菜单编号', - `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '创建者', + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', diff --git a/sql/postgresql/ruoyi-vue-pro.sql b/sql/postgresql/ruoyi-vue-pro.sql index 7484486c2..c16a51f75 100644 --- a/sql/postgresql/ruoyi-vue-pro.sql +++ b/sql/postgresql/ruoyi-vue-pro.sql @@ -3817,7 +3817,7 @@ CREATE TABLE "system_tenant" ( "package_id" int8 NOT NULL, "expire_time" timestamp(6) NOT NULL, "account_count" int4 NOT NULL, - "creator" varchar(64) COLLATE "pg_catalog"."default" NOT NULL, + "creator" varchar(64) COLLATE "pg_catalog"."default", "create_time" timestamp(6) NOT NULL, "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, @@ -3860,7 +3860,7 @@ CREATE TABLE "system_tenant_package" ( "status" int2 NOT NULL, "remark" varchar(256) COLLATE "pg_catalog"."default", "menu_ids" varchar(2048) COLLATE "pg_catalog"."default" NOT NULL, - "creator" varchar(64) COLLATE "pg_catalog"."default" NOT NULL, + "creator" varchar(64) COLLATE "pg_catalog"."default", "create_time" timestamp(6) NOT NULL, "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, diff --git a/sql/sqlserver/ruoyi-vue-pro.sql b/sql/sqlserver/ruoyi-vue-pro.sql index 386e9bd2e..dd728f2c7 100644 --- a/sql/sqlserver/ruoyi-vue-pro.sql +++ b/sql/sqlserver/ruoyi-vue-pro.sql @@ -10600,7 +10600,7 @@ CREATE TABLE [dbo].[system_tenant] ( [package_id] bigint NOT NULL, [expire_time] datetime2(7) NOT NULL, [account_count] int NOT NULL, - [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [create_time] datetime2(7) NOT NULL, [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [update_time] datetime2(7) NOT NULL, @@ -10761,7 +10761,7 @@ CREATE TABLE [dbo].[system_tenant_package] ( [status] tinyint NOT NULL, [remark] nvarchar(256) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [menu_ids] nvarchar(2048) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, - [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, + [creator] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [create_time] datetime2(7) NOT NULL, [updater] nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [update_time] datetime2(7) NOT NULL, diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/clean.sql b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/clean.sql index eb05d3d5a..3dc20f7ba 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/clean.sql @@ -1,12 +1,10 @@ DELETE FROM "infra_config"; +DELETE FROM "infra_file_config"; DELETE FROM "infra_file"; DELETE FROM "infra_job"; DELETE FROM "infra_job_log"; DELETE FROM "infra_api_access_log"; DELETE FROM "infra_api_error_log"; -DELETE FROM "infra_api_access_log"; -DELETE FROM "infra_file"; -DELETE FROM "infra_api_error_log"; -DELETE FROM "infra_test_demo"; DELETE FROM "infra_file_config"; +DELETE FROM "infra_test_demo"; DELETE FROM "infra_data_source_config"; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql index 5825e0fef..e490b8779 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql @@ -85,19 +85,6 @@ CREATE TABLE IF NOT EXISTS "infra_job_log" ( PRIMARY KEY ("id") )COMMENT='定时任务日志表'; -CREATE TABLE IF NOT EXISTS "inf_file" ( - "id" varchar(188) NOT NULL, - "type" varchar(63) DEFAULT NULL, - "content" blob NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - "tenant_id" bigint not null default '0', - PRIMARY KEY ("id") - ) COMMENT '文件表'; - CREATE TABLE IF NOT EXISTS "infra_api_access_log" ( "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, "trace_id" varchar(64) not null default '', diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql index aad191337..3acd7a48e 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/clean.sql @@ -1,3 +1,6 @@ DELETE FROM "product_sku"; +DELETE FROM "product_spu"; +DELETE FROM "product_category"; + + -DELETE FROM "product_spu"; \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql index 9d26cc733..6b0ffc7c7 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-mall/yudao-module-product-biz/src/test/resources/sql/create_tables.sql @@ -21,7 +21,6 @@ CREATE TABLE IF NOT EXISTS `product_sku` ( PRIMARY KEY (`id`) ) COMMENT '商品sku'; - CREATE TABLE IF NOT EXISTS `product_spu` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', diff --git a/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql b/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql index b0347b058..9724c80d6 100644 --- a/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-member/yudao-module-member-biz/src/test/resources/sql/create_tables.sql @@ -17,19 +17,6 @@ CREATE TABLE IF NOT EXISTS "member_user" ( PRIMARY KEY ("id") ) COMMENT '会员表'; --- inf 开头的 DB -CREATE TABLE IF NOT EXISTS "inf_file" ( - "id" varchar(188) NOT NULL, - "type" varchar(63) DEFAULT NULL, - "content" blob NOT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - "deleted" bit NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '文件表'; - CREATE TABLE IF NOT EXISTS "member_address" ( "id" bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, "user_id" bigint(20) NOT NULL, diff --git a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql index b13b191db..dac3d6870 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql @@ -4,10 +4,11 @@ DELETE FROM "system_role"; DELETE FROM "system_role_menu"; DELETE FROM "system_menu"; DELETE FROM "system_user_role"; -DELETE FROM "system_user_post"; DELETE FROM "system_dict_type"; DELETE FROM "system_user_session"; DELETE FROM "system_post"; +DELETE FROM "system_user_post"; +DELETE FROM "system_notice"; DELETE FROM "system_login_log"; DELETE FROM "system_operate_log"; DELETE FROM "system_users"; @@ -24,4 +25,4 @@ DELETE FROM "system_oauth2_client"; DELETE FROM "system_oauth2_approve"; DELETE FROM "system_oauth2_access_token"; DELETE FROM "system_oauth2_refresh_token"; -DELETE FROM "system_oauth2_code"; +DELETE FROM "system_oauth2_code"; \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql index 7590e57a3..f50c27a57 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql @@ -162,7 +162,6 @@ CREATE TABLE IF NOT EXISTS `system_user_post`( PRIMARY KEY (`id`) ) COMMENT ='用户岗位表'; - CREATE TABLE IF NOT EXISTS "system_notice" ( "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "title" varchar(50) NOT NULL COMMENT '公告标题', @@ -250,63 +249,6 @@ CREATE TABLE IF NOT EXISTS "system_users" ( primary key ("id") ) comment '用户信息表'; -CREATE TABLE IF NOT EXISTS "inf_api_access_log" ( - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, - "trace_id" varchar(64) not null default '', - "user_id" bigint not null default '0', - "user_type" tinyint not null default '0', - "application_name" varchar(50) not null, - "request_method" varchar(16) not null default '', - "request_url" varchar(255) not null default '', - "request_params" varchar(8000) not null default '', - "user_ip" varchar(50) not null, - "user_agent" varchar(512) not null, - "begin_time" timestamp not null, - "end_time" timestamp not null, - "duration" integer not null, - "result_code" integer not null default '0', - "result_msg" varchar(512) default '', - "creator" varchar(64) default '', - "create_time" timestamp not null default current_timestamp, - "updater" varchar(64) default '', - "update_time" timestamp not null default current_timestamp, - "deleted" bit not null default false, - "tenant_id" bigint not null default '0', - primary key ("id") -) COMMENT 'API 访问日志表'; - -CREATE TABLE IF NOT EXISTS "inf_api_error_log" ( - "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, - "trace_id" varchar(64) not null, - "user_id" bigint not null default '0', - "user_type" tinyint not null default '0', - "application_name" varchar(50) not null, - "request_method" varchar(16) not null, - "request_url" varchar(255) not null, - "request_params" varchar(8000) not null, - "user_ip" varchar(50) not null, - "user_agent" varchar(512) not null, - "exception_time" timestamp not null, - "exception_name" varchar(128) not null default '', - "exception_message" clob not null, - "exception_root_cause_message" clob not null, - "exception_stack_trace" clob not null, - "exception_class_name" varchar(512) not null, - "exception_file_name" varchar(512) not null, - "exception_method_name" varchar(512) not null, - "exception_line_number" integer not null, - "process_status" tinyint not null, - "process_time" timestamp default null, - "process_user_id" bigint default '0', - "creator" varchar(64) default '', - "create_time" timestamp not null default current_timestamp, - "updater" varchar(64) default '', - "update_time" timestamp not null default current_timestamp, - "deleted" bit not null default false, - "tenant_id" bigint not null default '0', - primary key ("id") -) COMMENT '系统异常日志'; - CREATE TABLE IF NOT EXISTS "system_sms_channel" ( "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, "signature" varchar(10) NOT NULL,