Skip to content

Commit a65e101

Browse files
committed
Upgrade to Flyway 10.10
Closes gh-40022
1 parent e3f8c34 commit a65e101

File tree

10 files changed

+59
-255
lines changed

10 files changed

+59
-255
lines changed

spring-boot-project/spring-boot-autoconfigure/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ dependencies {
9595
exclude group: "commons-logging", module: "commons-logging"
9696
}
9797
optional("org.flywaydb:flyway-core")
98+
optional("org.flywaydb:flyway-database-postgresql")
9899
optional("org.flywaydb:flyway-database-oracle")
99100
optional("org.flywaydb:flyway-sqlserver")
100101
optional("org.freemarker:freemarker")
@@ -250,6 +251,7 @@ dependencies {
250251
testImplementation("org.yaml:snakeyaml")
251252

252253
testRuntimeOnly("jakarta.management.j2ee:jakarta.management.j2ee-api")
254+
testRuntimeOnly("org.flywaydb:flyway-database-hsqldb")
253255
testRuntimeOnly("org.jetbrains.kotlin:kotlin-reflect")
254256
}
255257

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,8 +35,8 @@
3535
import org.flywaydb.core.api.configuration.FluentConfiguration;
3636
import org.flywaydb.core.api.migration.JavaMigration;
3737
import org.flywaydb.core.extensibility.ConfigurationExtension;
38-
import org.flywaydb.core.internal.database.postgresql.PostgreSQLConfigurationExtension;
3938
import org.flywaydb.database.oracle.OracleConfigurationExtension;
39+
import org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension;
4040
import org.flywaydb.database.sqlserver.SQLServerConfigurationExtension;
4141

4242
import org.springframework.aot.hint.RuntimeHints;
@@ -157,7 +157,7 @@ OracleFlywayConfigurationCustomizer oracleFlywayConfigurationCustomizer() {
157157
}
158158

159159
@Bean
160-
@ConditionalOnClass(name = "org.flywaydb.core.internal.database.postgresql.PostgreSQLConfigurationExtension")
160+
@ConditionalOnClass(name = "org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension")
161161
PostgresqlFlywayConfigurationCustomizer postgresqlFlywayConfigurationCustomizer() {
162162
return new PostgresqlFlywayConfigurationCustomizer(this.properties);
163163
}
@@ -305,11 +305,7 @@ private void configureProperties(FluentConfiguration configuration, FlywayProper
305305
map.from(properties.getDryRunOutput()).to((dryRunOutput) -> configuration.dryRunOutput(dryRunOutput));
306306
map.from(properties.getErrorOverrides())
307307
.to((errorOverrides) -> configuration.errorOverrides(errorOverrides));
308-
map.from(properties.getLicenseKey()).to((licenseKey) -> configuration.licenseKey(licenseKey));
309308
map.from(properties.getStream()).to((stream) -> configuration.stream(stream));
310-
map.from(properties.getUndoSqlMigrationPrefix())
311-
.to((undoSqlMigrationPrefix) -> configuration.undoSqlMigrationPrefix(undoSqlMigrationPrefix));
312-
map.from(properties.getCherryPick()).to((cherryPick) -> configuration.cherryPick(cherryPick));
313309
map.from(properties.getJdbcProperties())
314310
.whenNot(Map::isEmpty)
315311
.to((jdbcProperties) -> configuration.jdbcProperties(jdbcProperties));

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -291,27 +291,11 @@ public class FlywayProperties {
291291
*/
292292
private String[] errorOverrides;
293293

294-
/**
295-
* Licence key for Flyway Teams.
296-
*/
297-
private String licenseKey;
298-
299294
/**
300295
* Whether to stream SQL migrations when executing them. Requires Flyway Teams.
301296
*/
302297
private Boolean stream;
303298

304-
/**
305-
* File name prefix for undo SQL migrations. Requires Flyway Teams.
306-
*/
307-
private String undoSqlMigrationPrefix;
308-
309-
/**
310-
* Migrations that Flyway should consider when migrating or undoing. When empty all
311-
* available migrations are considered. Requires Flyway Teams.
312-
*/
313-
private String[] cherryPick;
314-
315299
/**
316300
* Properties to pass to the JDBC driver. Requires Flyway Teams.
317301
*/
@@ -728,14 +712,6 @@ public void setErrorOverrides(String[] errorOverrides) {
728712
this.errorOverrides = errorOverrides;
729713
}
730714

731-
public String getLicenseKey() {
732-
return this.licenseKey;
733-
}
734-
735-
public void setLicenseKey(String licenseKey) {
736-
this.licenseKey = licenseKey;
737-
}
738-
739715
@DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.sqlplus", since = "3.2.0")
740716
@Deprecated(since = "3.2.0", forRemoval = true)
741717
public Boolean getOracleSqlplus() {
@@ -777,22 +753,6 @@ public void setStream(Boolean stream) {
777753
this.stream = stream;
778754
}
779755

780-
public String getUndoSqlMigrationPrefix() {
781-
return this.undoSqlMigrationPrefix;
782-
}
783-
784-
public void setUndoSqlMigrationPrefix(String undoSqlMigrationPrefix) {
785-
this.undoSqlMigrationPrefix = undoSqlMigrationPrefix;
786-
}
787-
788-
public String[] getCherryPick() {
789-
return this.cherryPick;
790-
}
791-
792-
public void setCherryPick(String[] cherryPick) {
793-
this.cherryPick = cherryPick;
794-
}
795-
796756
public Map<String, String> getJdbcProperties() {
797757
return this.jdbcProperties;
798758
}

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/NativeImageResourceProviderCustomizer.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,10 +35,8 @@ class NativeImageResourceProviderCustomizer extends ResourceProviderCustomizer {
3535
@Override
3636
public void customize(FluentConfiguration configuration) {
3737
if (configuration.getResourceProvider() == null) {
38-
Scanner<JavaMigration> scanner = new Scanner<>(JavaMigration.class,
39-
Arrays.asList(configuration.getLocations()), configuration.getClassLoader(),
40-
configuration.getEncoding(), configuration.isDetectEncoding(), false, new ResourceNameCache(),
41-
new LocationScannerCache(), configuration.isFailOnMissingLocations());
38+
Scanner<JavaMigration> scanner = new Scanner<>(JavaMigration.class, false, new ResourceNameCache(),
39+
new LocationScannerCache(), configuration);
4240
NativeImageResourceProvider resourceProvider = new NativeImageResourceProvider(scanner,
4341
configuration.getClassLoader(), Arrays.asList(configuration.getLocations()),
4442
configuration.getEncoding(), configuration.isFailOnMissingLocations());

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/Flyway10xAutoConfigurationTests.java

Lines changed: 0 additions & 57 deletions
This file was deleted.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/Flyway90AutoConfigurationTests.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/Flyway91AutoConfigurationTests.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)