Skip to content

Commit 18ce04b

Browse files
authored
Merge pull request #174 from zonkyio/flyway-7.9
#172 Fix breaking changes in Flyway 7.9.0
2 parents 46d2b20 + 92ed0c6 commit 18ce04b

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

build.gradle

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,20 @@ ext {
3737
[name: '6.3.3', flyway: '6.3.3', 'flyway-test': '6.3.3', spring: '5.2.10.RELEASE', 'spring-boot': '2.2.11.RELEASE', 'zonky-postgres': 'default'],
3838
[name: '6.4.4', flyway: '6.4.4', 'flyway-test': '6.4.0', spring: '5.2.10.RELEASE', 'spring-boot': '2.2.11.RELEASE', 'zonky-postgres': 'default'],
3939
[name: '6.5.7', flyway: '6.5.7', 'flyway-test': '6.4.0', spring: '5.2.10.RELEASE', 'spring-boot': '2.2.11.RELEASE', 'zonky-postgres': 'default'],
40-
[name: '7.0.4', flyway: '7.0.4', 'flyway-test': '7.0.0', spring: '5.3.1', 'spring-boot': '2.4.0', 'zonky-postgres': 'default'],
41-
[name: '7.1.1', flyway: '7.1.1', 'flyway-test': '7.0.0', spring: '5.3.1', 'spring-boot': '2.4.0', 'zonky-postgres': 'default'],
42-
[name: '7.2.1', flyway: '7.2.1', 'flyway-test': '7.0.0', spring: '5.3.1', 'spring-boot': '2.4.0', 'zonky-postgres': 'default'],
43-
[name: '7.3.2', flyway: '7.3.2', 'flyway-test': '7.0.0', spring: '5.3.1', 'spring-boot': '2.4.0', 'zonky-postgres': 'default'],
44-
[name: '7.4.0', flyway: '7.4.0', 'flyway-test': '7.0.0', spring: '5.3.1', 'spring-boot': '2.4.0', 'zonky-postgres': 'default'],
45-
[name: '7.5.4', flyway: '7.5.4', 'flyway-test': '7.0.0', spring: '5.3.1', 'spring-boot': '2.4.0', 'zonky-postgres': 'default'],
46-
[name: '7.6.0', flyway: '7.6.0', 'flyway-test': '7.0.0', spring: '5.3.1', 'spring-boot': '2.4.0', 'zonky-postgres': 'default'],
47-
[name: '7.7.3', flyway: '7.7.3', 'flyway-test': '7.0.0', spring: '5.3.1', 'spring-boot': '2.4.0', 'zonky-postgres': 'default'],
48-
[name: '7.8.2', flyway: '7.8.2', 'flyway-test': '7.0.0', spring: '5.3.1', 'spring-boot': '2.4.0', 'zonky-postgres': 'default'],
40+
[name: '7.0.4', flyway: '7.0.4', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.4.9', 'zonky-postgres': 'default'],
41+
[name: '7.1.1', flyway: '7.1.1', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.4.9', 'zonky-postgres': 'default'],
42+
[name: '7.2.1', flyway: '7.2.1', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.4.9', 'zonky-postgres': 'default'],
43+
[name: '7.3.2', flyway: '7.3.2', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.4.9', 'zonky-postgres': 'default'],
44+
[name: '7.4.0', flyway: '7.4.0', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.4.9', 'zonky-postgres': 'default'],
45+
[name: '7.5.4', flyway: '7.5.4', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.4.9', 'zonky-postgres': 'default'],
46+
[name: '7.6.0', flyway: '7.6.0', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.4.9', 'zonky-postgres': 'default'],
47+
[name: '7.7.3', flyway: '7.7.3', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.5.3', 'zonky-postgres': 'default'],
48+
[name: '7.8.2', flyway: '7.8.2', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.5.3', 'zonky-postgres': 'default'],
49+
[name: '7.9.2', flyway: '7.9.2', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.5.3', 'zonky-postgres': 'default'],
50+
[name: '7.10.0', flyway: '7.10.0', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.5.3', 'zonky-postgres': 'default'],
51+
[name: '7.11.4', flyway: '7.11.4', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.5.3', 'zonky-postgres': 'default'],
52+
[name: '7.12.1', flyway: '7.12.1', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.5.3', 'zonky-postgres': 'default'],
53+
[name: '7.13.0', flyway: '7.13.0', 'flyway-test': '7.0.0', spring: '5.3.9', 'spring-boot': '2.5.3', 'zonky-postgres': 'default'],
4954
[name: 'no_sb', flyway: 'default', 'flyway-test': 'default', 'zonky-postgres': 'default']
5055
]],
5156
[name: 'liquibase', versions: [
@@ -54,10 +59,12 @@ ext {
5459
[name: '3.7.0', liquibase: '3.7.0', spring: '5.1.19.RELEASE', 'spring-boot': '2.1.18.RELEASE'],
5560
[name: '3.8.9', liquibase: '3.8.9', spring: '5.2.10.RELEASE', 'spring-boot': '2.2.11.RELEASE'],
5661
[name: '3.9.0', liquibase: '3.9.0', spring: '5.2.10.RELEASE', 'spring-boot': '2.2.11.RELEASE'],
57-
[name: '3.10.3', liquibase: '3.10.3', spring: '5.3.1', 'spring-boot': '2.4.0'],
58-
[name: '4.0.0', liquibase: '4.0.0', spring: '5.3.1', 'spring-boot': '2.4.0'],
59-
[name: '4.1.1', liquibase: '4.1.1', spring: '5.3.1', 'spring-boot': '2.4.0'],
60-
[name: '4.2.0', liquibase: '4.2.0', spring: '5.3.1', 'spring-boot': '2.4.0'],
62+
[name: '3.10.3', liquibase: '3.10.3', spring: '5.3.9', 'spring-boot': '2.4.9'],
63+
[name: '4.0.0', liquibase: '4.0.0', spring: '5.3.9', 'spring-boot': '2.4.9'],
64+
[name: '4.1.1', liquibase: '4.1.1', spring: '5.3.9', 'spring-boot': '2.4.9'],
65+
[name: '4.2.2', liquibase: '4.2.2', spring: '5.3.9', 'spring-boot': '2.4.9'],
66+
[name: '4.3.5', liquibase: '4.3.5', spring: '5.3.9', 'spring-boot': '2.5.3'],
67+
[name: '4.4.3', liquibase: '4.4.3', spring: '5.3.9', 'spring-boot': '2.5.3'],
6168
[name: 'no_sb', liquibase: 'default']
6269
]],
6370
[name: 'postgres', versions: [
@@ -213,7 +220,7 @@ project(':embedded-database-spring-test') {
213220
compile 'mysql:mysql-connector-java:8.0.22', optional
214221
compile 'org.mariadb.jdbc:mariadb-java-client:2.7.0', optional
215222

216-
compile 'org.flywaydb:flyway-core:7.3.0', optional
223+
compile 'org.flywaydb:flyway-core:7.13.0', optional
217224
compile 'org.flywaydb.flyway-test-extensions:flyway-spring-test:7.0.0', optional
218225
compile 'org.springframework.boot:spring-boot-starter-test:2.0.9.RELEASE', optional
219226
compile 'org.liquibase:liquibase-core:3.5.5', optional

embedded-database-spring-test/src/main/java/io/zonky/test/db/flyway/FlywayWrapper.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,18 @@ private MigrationResolver createMigrationResolver(Flyway flyway) throws ClassNot
136136
}
137137

138138
private Object createScanner(Flyway flyway) throws ClassNotFoundException {
139+
if (flywayVersion >= 79) {
140+
return invokeConstructor("org.flywaydb.core.internal.scanner.Scanner",
141+
ClassUtils.forName("org.flywaydb.core.api.migration.JavaMigration", classLoader),
142+
Arrays.asList((Object[]) invokeMethod(config, "getLocations")),
143+
invokeMethod(config, "getClassLoader"),
144+
invokeMethod(config, "getEncoding"),
145+
invokeMethod(config, "getDetectEncoding"),
146+
false,
147+
getField(flyway, "resourceNameCache"),
148+
getField(flyway, "locationScannerCache"),
149+
invokeMethod(config, "getFailOnMissingLocations"));
150+
}
139151
if (flywayVersion >= 70) {
140152
return invokeConstructor("org.flywaydb.core.internal.scanner.Scanner",
141153
ClassUtils.forName("org.flywaydb.core.api.migration.JavaMigration", classLoader),

0 commit comments

Comments
 (0)