Skip to content

Commit

Permalink
Remove cleanOnValidationError config in Flyway
Browse files Browse the repository at this point in the history
Starting in Flyway 11.0.0 (see https://documentation.red-gate.com/flyway/release-notes-and-older-versions/release-notes-for-flyway-engine), the `cleanOnValidationError` function and configuration has been removed.
An error will be thrown if this feature is configured.

Therefore it is better to remove this configuration from Quarkus so applications using it would fail as well (instead of deprecating it)
  • Loading branch information
gastaldi committed Dec 3, 2024
1 parent 6a487f0 commit 58f6144
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 58f6144

Please sign in to comment.