Skip to content

Commit dcc6d8d

Browse files
eddumelendezwilkinsona
authored andcommitted
Align default of flyway.check-location with equivalent Liquibase prop
Closes gh-10807
1 parent 8eae372 commit dcc6d8d

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* properties into the {@link Flyway} instance.
3232
*
3333
* @author Dave Syer
34+
* @author Eddú Meléndez
3435
* @since 1.1.0
3536
*/
3637
@ConfigurationProperties(prefix = "spring.flyway", ignoreUnknownFields = true)
@@ -46,7 +47,7 @@ public class FlywayProperties {
4647
/**
4748
* Check that migration scripts location exists.
4849
*/
49-
private boolean checkLocation = false;
50+
private boolean checkLocation = true;
5051

5152
/**
5253
* Enable flyway.

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ public void changeLogDoesNotExist() {
173173
public void checkLocationsAllMissing() {
174174
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
175175
.withPropertyValues(
176-
"spring.flyway.locations:classpath:db/missing1,classpath:db/migration2",
177-
"spring.flyway.check-location:true")
176+
"spring.flyway.locations:classpath:db/missing1,classpath:db/migration2")
178177
.run((context) -> {
179178
assertThat(context).hasFailed();
180179
assertThat(context).getFailure()
@@ -188,8 +187,7 @@ public void checkLocationsAllMissing() {
188187
public void checkLocationsAllExist() {
189188
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
190189
.withPropertyValues(
191-
"spring.flyway.locations:classpath:db/changelog,classpath:db/migration",
192-
"spring.flyway.check-location:true")
190+
"spring.flyway.locations:classpath:db/changelog,classpath:db/migration")
193191
.run((context) -> assertThat(context).hasNotFailed());
194192
}
195193

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ content into your application; rather pick only the properties that you need.
487487
spring.flyway.baseline-description= #
488488
spring.flyway.baseline-on-migrate= #
489489
spring.flyway.baseline-version=1 # version to start migration
490-
spring.flyway.check-location=false # Check that migration scripts location exists.
490+
spring.flyway.check-location=true # Check that migration scripts location exists.
491491
spring.flyway.clean-disabled= #
492492
spring.flyway.clean-on-validation-error= #
493493
spring.flyway.enabled=true # Enable flyway.

0 commit comments

Comments
 (0)