Merge branch 'test' of http://8.163.30.128:10082/java-project/baiyue-firstleg into dev
This commit is contained in:
+16
@@ -31,6 +31,22 @@ class FeeItemMigrationSqlContractTest {
|
|||||||
.doesNotContain("OR EXISTS (SELECT trade_scope, fee_type_name FROM tmp_fee_item_seed");
|
.doesNotContain("OR EXISTS (SELECT trade_scope, fee_type_name FROM tmp_fee_item_seed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void inboundFeeSourceIndexUsesTheFinalVersionedDefinition() throws Exception {
|
||||||
|
assertFinalSourceIndex(resolve("deploy/sql/头程数据库统一增量-MySQL8.sql"));
|
||||||
|
assertFinalSourceIndex(resolve(
|
||||||
|
"firstleg/src/main/resources/db/phase2-published-freight-detail-migration.sql"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void assertFinalSourceIndex(Path path) throws Exception {
|
||||||
|
String sql = Files.readString(path, StandardCharsets.UTF_8);
|
||||||
|
assertThat(sql)
|
||||||
|
.contains("UNIQUE KEY `uk_inbound_fee_source` "
|
||||||
|
+ "(`tenant_id`, `source_type`, `source_fee_id`, `source_fee_version`)")
|
||||||
|
.doesNotContain("inbound_fee_source_index_ddl")
|
||||||
|
.doesNotContain("DROP INDEX uk_inbound_fee_source");
|
||||||
|
}
|
||||||
|
|
||||||
private static Path resolve(String value) {
|
private static Path resolve(String value) {
|
||||||
Path direct = Path.of(value);
|
Path direct = Path.of(value);
|
||||||
if (Files.exists(direct)) return direct;
|
if (Files.exists(direct)) return direct;
|
||||||
|
|||||||
Reference in New Issue
Block a user