Browse Source

Upgrade to Flyway 7.13.0

Closes gh-27644
pull/27659/head
Andy Wilkinson 5 years ago
parent
commit
42fb40b202
  1. 6
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
  2. 69
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java
  3. 24
      spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  4. 7
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/Flyway5xAutoConfigurationTests.java
  5. 26
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java
  6. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java
  7. 2
      spring-boot-project/spring-boot-dependencies/build.gradle

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

@ -248,12 +248,6 @@ public class FlywayAutoConfiguration { @@ -248,12 +248,6 @@ public class FlywayAutoConfiguration {
// No method reference for compatibility with Flyway 6.x
map.from(properties.getSkipExecutingMigrations())
.to((skipExecutingMigrations) -> configuration.skipExecutingMigrations(skipExecutingMigrations));
// Teams secrets management properties (all non-method reference for
// compatibility with Flyway 6.x)
map.from(properties.getVaultUrl()).to((vaultUrl) -> configuration.vaultUrl(vaultUrl));
map.from(properties.getVaultToken()).to((vaultToken) -> configuration.vaultToken(vaultToken));
map.from(properties.getVaultSecrets()).whenNot(List::isEmpty)
.to((vaultSecrets) -> configuration.vaultSecrets(vaultSecrets.toArray(new String[0])));
// No method reference for compatibility with Flyway < 7.8
map.from(properties.getIgnoreMigrationPatterns()).whenNot(List::isEmpty)
.to((ignoreMigrationPatterns) -> configuration

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

@ -330,6 +330,12 @@ public class FlywayProperties { @@ -330,6 +330,12 @@ public class FlywayProperties {
*/
private String oracleKerberosConfigFile;
/**
* Location of the Oracle Wallet, used to sign-in to the database automatically.
* Requires Flyway Teams.
*/
private String oracleWalletLocation;
/**
* Whether Flyway should output a table with the results of queries when executing
* migrations. Requires Flyway Teams.
@ -342,24 +348,6 @@ public class FlywayProperties { @@ -342,24 +348,6 @@ public class FlywayProperties {
*/
private Boolean skipExecutingMigrations;
/**
* REST API URL of the Vault server. Requires Flyway teams.
*/
private String vaultUrl;
/**
* Vault token required to access secrets. Requires Flyway teams.
*/
private String vaultToken;
/**
* Comma-separated list of paths to secrets that contain Flyway configurations. This
* must start with the name of the engine followed by '/data/' and end with the name
* of the secret. The resulting form is '{engine}/data/{path}/{to}/{secret_name}'.
* Requires Flyway teams.
*/
private List<String> vaultSecrets;
/**
* Ignore migrations that match this comma-separated list of patterns when validating
* migrations. Requires Flyway Teams.
@ -372,6 +360,11 @@ public class FlywayProperties { @@ -372,6 +360,11 @@ public class FlywayProperties {
*/
private Boolean detectEncoding;
/**
* Filename prefix of state scripts. Requires Flyway Teams.
*/
private String stateScriptPrefix;
public boolean isEnabled() {
return this.enabled;
}
@ -779,6 +772,14 @@ public class FlywayProperties { @@ -779,6 +772,14 @@ public class FlywayProperties {
this.oracleSqlplusWarn = oracleSqlplusWarn;
}
public String getOracleWalletLocation() {
return this.oracleWalletLocation;
}
public void setOracleWalletLocation(String oracleWalletLocation) {
this.oracleWalletLocation = oracleWalletLocation;
}
public Boolean getStream() {
return this.stream;
}
@ -843,30 +844,6 @@ public class FlywayProperties { @@ -843,30 +844,6 @@ public class FlywayProperties {
this.skipExecutingMigrations = skipExecutingMigrations;
}
public String getVaultUrl() {
return this.vaultUrl;
}
public void setVaultUrl(String vaultUrl) {
this.vaultUrl = vaultUrl;
}
public String getVaultToken() {
return this.vaultToken;
}
public void setVaultToken(String vaultToken) {
this.vaultToken = vaultToken;
}
public List<String> getVaultSecrets() {
return this.vaultSecrets;
}
public void setVaultSecrets(List<String> vaultSecrets) {
this.vaultSecrets = vaultSecrets;
}
public List<String> getIgnoreMigrationPatterns() {
return this.ignoreMigrationPatterns;
}
@ -883,4 +860,12 @@ public class FlywayProperties { @@ -883,4 +860,12 @@ public class FlywayProperties {
this.detectEncoding = detectEncoding;
}
public String getStateScriptPrefix() {
return this.stateScriptPrefix;
}
public void setStateScriptPrefix(String stateScriptPrefix) {
this.stateScriptPrefix = stateScriptPrefix;
}
}

24
spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -910,6 +910,30 @@ @@ -910,6 +910,30 @@
"reason": "Flyway pro edition only."
}
},
{
"name": "spring.flyway.vault-secrets",
"type": "java.util.List<java.lang.String>",
"deprecation": {
"level": "error",
"reason": "Removed in the open source release of Flyway 7.12."
}
},
{
"name": "spring.flyway.vault-token",
"type": "java.lang.String",
"deprecation": {
"level": "error",
"reason": "Removed in the open source release of Flyway 7.12."
}
},
{
"name": "spring.flyway.vault-url",
"type": "java.lang.String",
"deprecation": {
"level": "error",
"reason": "Removed in the open source release of Flyway 7.12."
}
},
{
"name": "spring.freemarker.prefix",
"defaultValue": ""

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -116,6 +116,11 @@ class Flyway5xAutoConfigurationTests { @@ -116,6 +116,11 @@ class Flyway5xAutoConfigurationTests {
}
@Override
public boolean isStateScript() {
return false;
}
}
}

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

@ -629,27 +629,6 @@ class FlywayAutoConfigurationTests { @@ -629,27 +629,6 @@ class FlywayAutoConfigurationTests {
.run(validateFlywayTeamsPropertyOnly("skipExecutingMigrations"));
}
@Test
void vaultUrlIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.vault-url=https://example.com/secrets")
.run(validateFlywayTeamsPropertyOnly("vaultUrl"));
}
@Test
void vaultTokenIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.vault-token=5150")
.run(validateFlywayTeamsPropertyOnly("vaultToken"));
}
@Test
void vaultSecretsIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.vault-secrets=kv/data/test/1/config,kv/data/test/2/config")
.run(validateFlywayTeamsPropertyOnly("vaultSecrets"));
}
@Test
void whenFlywayIsAutoConfiguredThenJooqDslContextDependsOnFlywayBeans() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, JooqConfiguration.class)
@ -1028,6 +1007,11 @@ class FlywayAutoConfigurationTests { @@ -1028,6 +1007,11 @@ class FlywayAutoConfigurationTests {
}
@Override
public boolean isStateScript() {
return false;
}
}
}

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

@ -108,7 +108,7 @@ class FlywayPropertiesTests { @@ -108,7 +108,7 @@ class FlywayPropertiesTests {
ignoreProperties(configuration, "callbacks", "classLoader", "dataSource", "javaMigrations",
"javaMigrationClassProvider", "resourceProvider", "resolvers");
// Properties we don't want to expose
ignoreProperties(configuration, "resolversAsClassNames", "callbacksAsClassNames");
ignoreProperties(configuration, "resolversAsClassNames", "callbacksAsClassNames", "apiExtensions");
// Handled by the conversion service
ignoreProperties(configuration, "baselineVersionAsString", "encodingAsString", "locationsAsStrings",
"targetAsString");

2
spring-boot-project/spring-boot-dependencies/build.gradle

@ -309,7 +309,7 @@ bom { @@ -309,7 +309,7 @@ bom {
]
}
}
library("Flyway", "7.11.2") {
library("Flyway", "7.13.0") {
group("org.flywaydb") {
modules = [
"flyway-core"

Loading…
Cancel
Save