浏览代码

清理单元测试 sql 脚本

dengxiaobing 2 年之前
父节点
当前提交
df2c137fe2

+ 2 - 2
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 '更新时间',

+ 2 - 2
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,

+ 2 - 2
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,

+ 2 - 4
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";

+ 0 - 13
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 '',

+ 4 - 1
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";

+ 0 - 1
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 '租户编号',

+ 0 - 13
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,

+ 3 - 2
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";

+ 0 - 58
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,