Merge pull request #10807 from Eddu Melendez
* gh-10807: Align default of flyway.check-location with equivalent Liquibase prop
This commit is contained in:
commit
09b015babf
|
|
@ -31,6 +31,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
* properties into the {@link Flyway} instance.
|
* properties into the {@link Flyway} instance.
|
||||||
*
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
|
* @author Eddú Meléndez
|
||||||
* @since 1.1.0
|
* @since 1.1.0
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = "spring.flyway", ignoreUnknownFields = true)
|
@ConfigurationProperties(prefix = "spring.flyway", ignoreUnknownFields = true)
|
||||||
|
|
@ -46,7 +47,7 @@ public class FlywayProperties {
|
||||||
/**
|
/**
|
||||||
* Check that migration scripts location exists.
|
* Check that migration scripts location exists.
|
||||||
*/
|
*/
|
||||||
private boolean checkLocation = false;
|
private boolean checkLocation = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable flyway.
|
* Enable flyway.
|
||||||
|
|
|
||||||
|
|
@ -173,8 +173,7 @@ public class FlywayAutoConfigurationTests {
|
||||||
public void checkLocationsAllMissing() {
|
public void checkLocationsAllMissing() {
|
||||||
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
||||||
.withPropertyValues(
|
.withPropertyValues(
|
||||||
"spring.flyway.locations:classpath:db/missing1,classpath:db/migration2",
|
"spring.flyway.locations:classpath:db/missing1,classpath:db/migration2")
|
||||||
"spring.flyway.check-location:true")
|
|
||||||
.run((context) -> {
|
.run((context) -> {
|
||||||
assertThat(context).hasFailed();
|
assertThat(context).hasFailed();
|
||||||
assertThat(context).getFailure()
|
assertThat(context).getFailure()
|
||||||
|
|
@ -188,8 +187,7 @@ public class FlywayAutoConfigurationTests {
|
||||||
public void checkLocationsAllExist() {
|
public void checkLocationsAllExist() {
|
||||||
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
|
||||||
.withPropertyValues(
|
.withPropertyValues(
|
||||||
"spring.flyway.locations:classpath:db/changelog,classpath:db/migration",
|
"spring.flyway.locations:classpath:db/changelog,classpath:db/migration")
|
||||||
"spring.flyway.check-location:true")
|
|
||||||
.run((context) -> assertThat(context).hasNotFailed());
|
.run((context) -> assertThat(context).hasNotFailed());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -487,7 +487,7 @@ content into your application; rather pick only the properties that you need.
|
||||||
spring.flyway.baseline-description= #
|
spring.flyway.baseline-description= #
|
||||||
spring.flyway.baseline-on-migrate= #
|
spring.flyway.baseline-on-migrate= #
|
||||||
spring.flyway.baseline-version=1 # version to start migration
|
spring.flyway.baseline-version=1 # version to start migration
|
||||||
spring.flyway.check-location=false # Check that migration scripts location exists.
|
spring.flyway.check-location=true # Check that migration scripts location exists.
|
||||||
spring.flyway.clean-disabled= #
|
spring.flyway.clean-disabled= #
|
||||||
spring.flyway.clean-on-validation-error= #
|
spring.flyway.clean-on-validation-error= #
|
||||||
spring.flyway.enabled=true # Enable flyway.
|
spring.flyway.enabled=true # Enable flyway.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue