diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java index 77f41f55a0..711a12bce7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java @@ -188,6 +188,9 @@ public class FlywayAutoConfiguration { map.from(properties.getPlaceholders()).to(configuration::placeholders); map.from(properties.getPlaceholderPrefix()).to(configuration::placeholderPrefix); map.from(properties.getPlaceholderSuffix()).to(configuration::placeholderSuffix); + // No method reference for compatibility with Flyway version < 8.0 + map.from(properties.getPlaceholderSeparator()) + .to((placeHolderSeparator) -> configuration.placeholderSeparator(placeHolderSeparator)); map.from(properties.isPlaceholderReplacement()).to(configuration::placeholderReplacement); map.from(properties.getSqlMigrationPrefix()).to(configuration::sqlMigrationPrefix); map.from(properties.getSqlMigrationSuffixes()).as(StringUtils::toStringArray) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java index 075b21fbb8..9829b53042 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java @@ -146,6 +146,11 @@ public class FlywayProperties { */ private String placeholderSuffix = "}"; + /** + * Separator of default placeholders. + */ + private String placeholderSeparator; + /** * Perform placeholder replacement in migration scripts. */ @@ -538,6 +543,14 @@ public class FlywayProperties { this.placeholderSuffix = placeholderSuffix; } + public String getPlaceholderSeparator() { + return this.placeholderSeparator; + } + + public void setPlaceholderSeparator(String placeholderSeparator) { + this.placeholderSeparator = placeholderSeparator; + } + public boolean isPlaceholderReplacement() { return this.placeholderReplacement; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index c6583d470c..367b06ba72 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -923,6 +923,10 @@ "name": "spring.flyway.lock-retry-count", "defaultValue": 50 }, + { + "name": "spring.flyway.placeholder-separator", + "defaultValue": ":" + }, { "name": "spring.flyway.script-placeholder-prefix", "defaultValue": "FP__"