Skip to content

Commit 2a37168

Browse files
committed
Upgrade to Flyway 11.10.3
Closes gh-46496
1 parent feede5d commit 2a37168

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

module/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ private void configureProperties(FluentConfiguration configuration, FlywayProper
297297
.to((prefix) -> configuration.scriptPlaceholderPrefix(prefix));
298298
map.from(properties.getScriptPlaceholderSuffix())
299299
.to((suffix) -> configuration.scriptPlaceholderSuffix(suffix));
300+
map.from(properties.getPowershellExecutable())
301+
.to((powershellExecutable) -> configuration.powershellExecutable(powershellExecutable));
300302
configureExecuteInTransaction(configuration, properties, map);
301303
map.from(properties::getLoggers).to((loggers) -> configuration.loggers(loggers));
302304
map.from(properties::getCommunityDbSupportEnabled)

module/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayProperties.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ public class FlywayProperties {
258258
*/
259259
private String scriptPlaceholderSuffix = "__";
260260

261+
/**
262+
* PowerShell executable to use for running PowerShell scripts. Default to
263+
* "powershell" on Windows, "pwsh" on other platforms.
264+
*/
265+
private String powershellExecutable;
266+
261267
/**
262268
* Whether Flyway should execute SQL within a transaction.
263269
*/
@@ -661,6 +667,14 @@ public void setScriptPlaceholderSuffix(String scriptPlaceholderSuffix) {
661667
this.scriptPlaceholderSuffix = scriptPlaceholderSuffix;
662668
}
663669

670+
public String getPowershellExecutable() {
671+
return this.powershellExecutable;
672+
}
673+
674+
public void setPowershellExecutable(String powershellExecutable) {
675+
this.powershellExecutable = powershellExecutable;
676+
}
677+
664678
public boolean isExecuteInTransaction() {
665679
return this.executeInTransaction;
666680
}

module/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfigurationTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,14 @@ void outputQueryResultsIsCorrectlyMapped() {
748748
});
749749
}
750750

751+
@Test
752+
void powershellExecutableIsCorrectlyMapped() {
753+
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
754+
.withPropertyValues("spring.flyway.powershell-executable=my-pwsh")
755+
.run((context) -> assertThat(context.getBean(Flyway.class).getConfiguration().getPowershellExecutable())
756+
.isEqualTo("my-pwsh"));
757+
}
758+
751759
@Test
752760
void postgresqlExtensionIsNotLoadedByDefault() {
753761
FluentConfiguration configuration = mock(FluentConfiguration.class);

module/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayPropertiesTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void defaultValuesAreConsistent() {
7171
assertThat(properties.getPlaceholderPrefix()).isEqualToIgnoringWhitespace(configuration.getPlaceholderPrefix());
7272
assertThat(properties.getPlaceholderSuffix()).isEqualTo(configuration.getPlaceholderSuffix());
7373
assertThat(properties.isPlaceholderReplacement()).isEqualTo(configuration.isPlaceholderReplacement());
74+
assertThat(properties.getPowershellExecutable()).isEqualTo(configuration.getPowershellExecutable());
7475
assertThat(properties.getSqlMigrationPrefix()).isEqualTo(configuration.getSqlMigrationPrefix());
7576
assertThat(properties.getSqlMigrationSuffixes()).containsExactly(configuration.getSqlMigrationSuffixes());
7677
assertThat(properties.getSqlMigrationSeparator()).isEqualTo(configuration.getSqlMigrationSeparator());

platform/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ bom {
383383
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")
384384
}
385385
}
386-
library("Flyway", "11.10.1") {
386+
library("Flyway", "11.10.3") {
387387
group("org.flywaydb") {
388388
modules = [
389389
"flyway-commandline",

0 commit comments

Comments
 (0)