Skip to content

Commit

Permalink
Merge pull request #44912 from gastaldi/flyway_deprecated
Browse files Browse the repository at this point in the history
Remove `cleanOnValidationError` config in Flyway
  • Loading branch information
geoand authored Dec 4, 2024
2 parents 0ac0e12 + 58f6144 commit 5006bf3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public Flyway createFlyway(DataSource dataSource) {
}

configure.ignoreMigrationPatterns(ignoreMigrationPatterns);
configure.cleanOnValidationError(flywayRuntimeConfig.cleanOnValidationError);
configure.outOfOrder(flywayRuntimeConfig.outOfOrder);
if (flywayRuntimeConfig.baselineVersion.isPresent()) {
configure.baselineVersion(flywayRuntimeConfig.baselineVersion.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,6 @@ public static FlywayDataSourceRuntimeConfig defaultConfig() {
@ConfigItem
public boolean cleanDisabled;

/**
* true to automatically call clean when a validation error occurs, false otherwise.
*/
@ConfigItem
public boolean cleanOnValidationError;

/**
* true to execute Flyway automatically when the application starts, false otherwise.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,6 @@ void testIgnoreFutureMigrations() {
assertTrue(ValidatePatternUtils.isFutureIgnored(createdFlywayConfig().getIgnoreMigrationPatterns()));
}

@Test
@DisplayName("cleanOnValidationError defaults to false and is correctly set")
void testCleanOnValidationError() {
creator = new FlywayCreator(runtimeConfig, buildConfig);
assertEquals(runtimeConfig.cleanOnValidationError, createdFlywayConfig().isCleanOnValidationError());
assertFalse(runtimeConfig.cleanOnValidationError);

runtimeConfig.cleanOnValidationError = false;
creator = new FlywayCreator(runtimeConfig, buildConfig);
assertFalse(createdFlywayConfig().isCleanOnValidationError());

runtimeConfig.cleanOnValidationError = true;
creator = new FlywayCreator(runtimeConfig, buildConfig);
assertTrue(createdFlywayConfig().isCleanOnValidationError());
}

@ParameterizedTest
@MethodSource("validateOnMigrateOverwritten")
@DisplayName("validate on migrate overwritten in configuration")
Expand Down

0 comments on commit 5006bf3

Please sign in to comment.