Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cleanOnValidationError config in Flyway #44912

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading