This commit is contained in:
2026-08-15 11:12:19 +08:00
parent 557ab75319
commit c4adba57db
22 changed files with 95 additions and 32 deletions
@@ -28,7 +28,10 @@ class WarehouseSchemaContractTest {
"contact_phone", "contact_email", "country_code", "province", "city", "district", "address_line",
"postal_code", "status", "remark");
assertThat(sql).contains("CREATE TABLE IF NOT EXISTS wh_partner_type")
.contains("idx_wh_partner_type_scope");
.contains("idx_wh_partner_type_scope")
.contains("chk_wh_partner_type CHECK (partner_type IN ('CUSTOMER','CARRIER','SHIPPER','CONSIGNEE'))")
.contains("chk_wh_partner_type_value CHECK (partner_type IN ('CUSTOMER','CARRIER','SHIPPER','CONSIGNEE'))")
.doesNotContain("CUSTOMS_BROKER", "SUPPLIER或BOTH");
assertBaseColumns(sql);
}
@@ -138,6 +141,14 @@ class WarehouseSchemaContractTest {
.contains("库位活动预占或占用唯一约束不完整");
}
@Test
void unifiedSqlUsesOnlyNonSupplierPartnerTypes() throws IOException {
String unified = Files.readString(Path.of("..", "deploy", "sql", "头程数据库统一增量-MySQL8.sql"));
assertThat(tableDefinition(unified, "wh_partner"))
.contains("chk_wh_partner_type CHECK (partner_type IN ('CUSTOMER','CARRIER','SHIPPER','CONSIGNEE'))")
.doesNotContain("CUSTOMS_BROKER", "SUPPLIER或BOTH");
}
private static String read(String file) throws IOException {
return Files.readString(Path.of("src/main/resources/db", file));
}