From 7674c55cd7dd7386b5df5ad886200ec7c65eeaad Mon Sep 17 00:00:00 2001 From: Ben Gilbert Date: Tue, 16 May 2023 14:58:12 +0100 Subject: [PATCH] Align spring.flyway.execute-in-transaction property with Flyway default See gh-35447 --- .../boot/autoconfigure/flyway/FlywayProperties.java | 2 +- .../boot/autoconfigure/flyway/FlywayPropertiesTests.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java index a783355be91..e6c73a175f6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java @@ -365,7 +365,7 @@ public class FlywayProperties { /** * Whether Flyway should execute SQL within a transaction. */ - private boolean executeInTransaction; + private boolean executeInTransaction = true; public boolean isEnabled() { return this.enabled; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java index ecefacf2aee..e8adc2b0133 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayPropertiesTests.java @@ -92,6 +92,7 @@ class FlywayPropertiesTests { assertThat(properties.getPlaceholderSeparator()).isEqualTo(configuration.getPlaceholderSeparator()); assertThat(properties.getScriptPlaceholderPrefix()).isEqualTo(configuration.getScriptPlaceholderPrefix()); assertThat(properties.getScriptPlaceholderSuffix()).isEqualTo(configuration.getScriptPlaceholderSuffix()); + assertThat(properties.isExecuteInTransaction()).isEqualTo(configuration.isExecuteInTransaction()); } @Test