Upgrade to Flyway 11.10.3

Closes gh-46496
This commit is contained in:
Stéphane Nicoll
2025-07-22 16:00:57 +02:00
parent feede5d689
commit 2a37168521
5 changed files with 26 additions and 1 deletions
@@ -297,6 +297,8 @@ public class FlywayAutoConfiguration {
.to((prefix) -> configuration.scriptPlaceholderPrefix(prefix));
map.from(properties.getScriptPlaceholderSuffix())
.to((suffix) -> configuration.scriptPlaceholderSuffix(suffix));
map.from(properties.getPowershellExecutable())
.to((powershellExecutable) -> configuration.powershellExecutable(powershellExecutable));
configureExecuteInTransaction(configuration, properties, map);
map.from(properties::getLoggers).to((loggers) -> configuration.loggers(loggers));
map.from(properties::getCommunityDbSupportEnabled)
@@ -258,6 +258,12 @@ public class FlywayProperties {
*/
private String scriptPlaceholderSuffix = "__";
/**
* PowerShell executable to use for running PowerShell scripts. Default to
* "powershell" on Windows, "pwsh" on other platforms.
*/
private String powershellExecutable;
/**
* Whether Flyway should execute SQL within a transaction.
*/
@@ -661,6 +667,14 @@ public class FlywayProperties {
this.scriptPlaceholderSuffix = scriptPlaceholderSuffix;
}
public String getPowershellExecutable() {
return this.powershellExecutable;
}
public void setPowershellExecutable(String powershellExecutable) {
this.powershellExecutable = powershellExecutable;
}
public boolean isExecuteInTransaction() {
return this.executeInTransaction;
}
@@ -748,6 +748,14 @@ class FlywayAutoConfigurationTests {
});
}
@Test
void powershellExecutableIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("spring.flyway.powershell-executable=my-pwsh")
.run((context) -> assertThat(context.getBean(Flyway.class).getConfiguration().getPowershellExecutable())
.isEqualTo("my-pwsh"));
}
@Test
void postgresqlExtensionIsNotLoadedByDefault() {
FluentConfiguration configuration = mock(FluentConfiguration.class);
@@ -71,6 +71,7 @@ class FlywayPropertiesTests {
assertThat(properties.getPlaceholderPrefix()).isEqualToIgnoringWhitespace(configuration.getPlaceholderPrefix());
assertThat(properties.getPlaceholderSuffix()).isEqualTo(configuration.getPlaceholderSuffix());
assertThat(properties.isPlaceholderReplacement()).isEqualTo(configuration.isPlaceholderReplacement());
assertThat(properties.getPowershellExecutable()).isEqualTo(configuration.getPowershellExecutable());
assertThat(properties.getSqlMigrationPrefix()).isEqualTo(configuration.getSqlMigrationPrefix());
assertThat(properties.getSqlMigrationSuffixes()).containsExactly(configuration.getSqlMigrationSuffixes());
assertThat(properties.getSqlMigrationSeparator()).isEqualTo(configuration.getSqlMigrationSeparator());
@@ -383,7 +383,7 @@ bom {
javadoc("elasticsearch-rest-client-sniffer", version -> "https://artifacts.elastic.co/javadoc/org/elasticsearch/client/elasticsearch-rest-client-sniffer/%s".formatted(version), "org.elasticsearch.client.sniff")
}
}
library("Flyway", "11.10.1") {
library("Flyway", "11.10.3") {
group("org.flywaydb") {
modules = [
"flyway-commandline",