Upgrade to Flyway 7.1.0
Closes gh-23932
This commit is contained in:
@@ -173,6 +173,9 @@ public class FlywayAutoConfiguration {
|
||||
map.from(locations).to(configuration::locations);
|
||||
map.from(properties.getEncoding()).to(configuration::encoding);
|
||||
map.from(properties.getConnectRetries()).to(configuration::connectRetries);
|
||||
// No method reference for compatibility with Flyway 6.x
|
||||
map.from(properties.getLockRetryCount())
|
||||
.to((lockRetryCount) -> configuration.lockRetryCount(lockRetryCount));
|
||||
// No method reference for compatibility with Flyway 5.x
|
||||
map.from(properties.getDefaultSchema()).to((schema) -> configuration.defaultSchema(schema));
|
||||
map.from(properties.getSchemas()).as(StringUtils::toStringArray).to(configuration::schemas);
|
||||
|
||||
@@ -64,6 +64,11 @@ public class FlywayProperties {
|
||||
*/
|
||||
private int connectRetries;
|
||||
|
||||
/**
|
||||
* Maximum number of retries when trying to obtain a lock.
|
||||
*/
|
||||
private Integer lockRetryCount;
|
||||
|
||||
/**
|
||||
* Default schema name managed by Flyway (case-sensitive).
|
||||
*/
|
||||
@@ -363,6 +368,14 @@ public class FlywayProperties {
|
||||
this.connectRetries = connectRetries;
|
||||
}
|
||||
|
||||
public Integer getLockRetryCount() {
|
||||
return this.lockRetryCount;
|
||||
}
|
||||
|
||||
public void setLockRetryCount(Integer lockRetryCount) {
|
||||
this.lockRetryCount = lockRetryCount;
|
||||
}
|
||||
|
||||
public String getDefaultSchema() {
|
||||
return this.defaultSchema;
|
||||
}
|
||||
|
||||
@@ -856,6 +856,10 @@
|
||||
"classpath:db/migration"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "spring.flyway.lock-retry-count",
|
||||
"defaultValue": 50
|
||||
},
|
||||
{
|
||||
"name": "spring.flyway.sql-migration-suffix",
|
||||
"type": "java.lang.String",
|
||||
|
||||
@@ -51,6 +51,9 @@ class FlywayPropertiesTests {
|
||||
.isEqualTo(configuration.getLocations());
|
||||
assertThat(properties.getEncoding()).isEqualTo(configuration.getEncoding());
|
||||
assertThat(properties.getConnectRetries()).isEqualTo(configuration.getConnectRetries());
|
||||
// Can't assert lock retry count default as it is new in Flyway 7.1
|
||||
// Asserting hard-coded value in the metadata instead
|
||||
assertThat(configuration.getLockRetryCount()).isEqualTo(50);
|
||||
assertThat(properties.getDefaultSchema()).isEqualTo(configuration.getDefaultSchema());
|
||||
assertThat(properties.getSchemas()).isEqualTo(Arrays.asList(configuration.getSchemas()));
|
||||
assertThat(properties.isCreateSchemas()).isEqualTo(configuration.getCreateSchemas());
|
||||
|
||||
@@ -304,7 +304,7 @@ bom {
|
||||
]
|
||||
}
|
||||
}
|
||||
library("Flyway", "7.0.4") {
|
||||
library("Flyway", "7.1.0") {
|
||||
group("org.flywaydb") {
|
||||
modules = [
|
||||
"flyway-core"
|
||||
|
||||
Reference in New Issue
Block a user