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

Update descriptions of properties that no longer require Flyway Teams #44460

Closed
wants to merge 2 commits into from
Closed
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 @@ -306,7 +306,6 @@ private void configureProperties(FluentConfiguration configuration, FlywayProper
map.from(properties::getLoggers).to((loggers) -> configuration.loggers(loggers));
map.from(properties::getCommunityDbSupportEnabled)
.to((communityDbSupportEnabled) -> configuration.communityDBSupportEnabled(communityDbSupportEnabled));
// Flyway Teams properties
map.from(properties.getBatch()).to((batch) -> configuration.batch(batch));
map.from(properties.getDryRunOutput()).to((dryRunOutput) -> configuration.dryRunOutput(dryRunOutput));
map.from(properties.getErrorOverrides())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public class FlywayProperties {
private String[] loggers = { "slf4j" };

/**
* Whether to batch SQL statements when executing them. Requires Flyway Teams.
* Whether to batch SQL statements when executing them.
*/
private Boolean batch;

Expand All @@ -292,12 +292,12 @@ public class FlywayProperties {
private String[] errorOverrides;

/**
* Whether to stream SQL migrations when executing them. Requires Flyway Teams.
* Whether to stream SQL migrations when executing them.
*/
private Boolean stream;

/**
* Properties to pass to the JDBC driver. Requires Flyway Teams.
* Properties to pass to the JDBC driver.
*/
private Map<String, String> jdbcProperties = new HashMap<>();

Expand All @@ -308,25 +308,23 @@ public class FlywayProperties {

/**
* Whether Flyway should output a table with the results of queries when executing
* migrations. Requires Flyway Teams.
* migrations.
*/
private Boolean outputQueryResults;

/**
* Whether Flyway should skip executing the contents of the migrations and only update
* the schema history table. Requires Flyway teams.
* the schema history table.
*/
private Boolean skipExecutingMigrations;

/**
* List of patterns that identify migrations to ignore when performing validation.
* Requires Flyway Teams.
*/
private List<String> ignoreMigrationPatterns;

/**
* Whether to attempt to automatically detect SQL migration file encoding. Requires
* Flyway Teams.
* Whether to attempt to automatically detect SQL migration file encoding.
*/
private Boolean detectEncoding;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.flywaydb.core.api.callback.Event;
import org.flywaydb.core.api.configuration.FluentConfiguration;
import org.flywaydb.core.api.migration.JavaMigration;
import org.flywaydb.core.api.pattern.ValidatePattern;
import org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException;
import org.flywaydb.database.oracle.OracleConfigurationExtension;
import org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension;
Expand Down Expand Up @@ -916,6 +917,22 @@ void shouldRegisterResourceHints() {
assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/V1__init.sql")).accepts(runtimeHints);
}

@Test
void detectEncodingCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.detect-encoding=true")
.run((context) -> assertThat(context.getBean(Flyway.class).getConfiguration().isDetectEncoding())
.isEqualTo(true));
}

@Test
void ignoreMigrationPatternsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.ignore-migration-patterns=*:missing")
.run((context) -> assertThat(context.getBean(Flyway.class).getConfiguration().getIgnoreMigrationPatterns())
.containsExactly(ValidatePattern.fromPattern("*:missing")));
}

private ContextConsumer<AssertableApplicationContext> validateFlywayTeamsPropertyOnly(String propertyName) {
return (context) -> {
assertThat(context).hasFailed();
Expand Down