fix: keep order declaration schema in unified baseline
This commit is contained in:
+15
@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -47,6 +49,19 @@ class OrderDeclarationUpdateContractTest {
|
||||
assertThat(source).contains("ORDER_DECLARATION_UPDATED_V1", "platform:order:declaration:edit", "A0409");
|
||||
}
|
||||
|
||||
@Test
|
||||
void unifiedDatabaseEntryContainsDeclarationHeaderColumns() throws Exception {
|
||||
Path direct = Path.of("deploy", "sql", "头程数据库统一增量-MySQL8.sql");
|
||||
Path unified = Files.exists(direct) ? direct : Path.of("..", "deploy", "sql", "头程数据库统一增量-MySQL8.sql");
|
||||
String source = Files.readString(unified, StandardCharsets.UTF_8);
|
||||
|
||||
assertThat(source)
|
||||
.contains("expected_arrival_at DATETIME(3) NULL COMMENT '客户申报预计到货时间'")
|
||||
.contains("channel_changed TINYINT(1) NOT NULL DEFAULT 0 COMMENT '订单历史上是否由平台变更过渠道'")
|
||||
.contains("CALL unified_assert_column('baiyue_order', 'ord_order', 'expected_arrival_at')")
|
||||
.contains("CALL unified_assert_column('baiyue_order', 'ord_order', 'channel_changed')");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Map<String, Object> map(Object value) { return (Map<String, Object>) value; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user