This commit is contained in:
2026-08-07 15:19:21 +08:00
parent b0ea1a0c5c
commit a4a03a8ae8
7 changed files with 38 additions and 148 deletions
@@ -33,7 +33,6 @@ CALL phase1_add_column('ord_order', 'receiving_time', "VARCHAR(128) NULL COMMENT
CALL phase1_add_column('ord_order', 'channel_code', "VARCHAR(64) NULL COMMENT 'Shipping channel code'");
CALL phase1_add_column('ord_order', 'channel_name', "VARCHAR(128) NULL COMMENT 'Shipping channel snapshot'");
CALL phase1_add_column('ord_order', 'tax_mode', "VARCHAR(24) NULL COMMENT 'BUY_DECLARATION or TAX_REFUND'");
CALL phase1_add_column('ord_order', 'pricing_tax_mode', "VARCHAR(16) NULL COMMENT 'TAX_INCLUDED or TAX_EXCLUDED; independent from tax_mode'");
CALL phase1_add_column('ord_order', 'container_mode', "VARCHAR(24) NULL COMMENT 'FULL_CONTAINER or LCL'");
CALL phase1_add_column('ord_order', 'customs_inspection', "TINYINT(1) NULL COMMENT 'Whether customs inspection is required'");
CALL phase1_add_column('ord_order', 'destination_type', "VARCHAR(24) NULL COMMENT 'FBA, OVERSEAS or PRIVATE'");
@@ -163,17 +163,19 @@ class OrderIdempotencyServiceTest {
}
@Test
void newAndExistingDatabaseScriptsContainActualOrderWriteFields() throws Exception {
void baselineContainsCurrentOrderWriteFieldsWithoutAddingPreLaunchPricingMigration() throws Exception {
String baseline = new ClassPathResource("db/order.sql").getContentAsString(StandardCharsets.UTF_8);
String migration = new ClassPathResource("db/phase1-order-extension.sql")
.getContentAsString(StandardCharsets.UTF_8);
for (String column : new String[] {
"receiving_warehouse_address", "receiving_time", "express_company", "express_tracking_no", "pricing_tax_mode"
"receiving_warehouse_address", "receiving_time", "express_company", "express_tracking_no"
}) {
assertThat(baseline).contains(column);
assertThat(migration).contains(column);
}
assertThat(baseline).contains("pricing_tax_mode");
assertThat(migration).doesNotContain("phase1_add_column('ord_order', 'pricing_tax_mode'");
}
private OrderApplicationService service(OrderRepository repository) {