You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1957,14 +1957,18 @@ For instance, if you want to always initialize the `DataSource` regardless of it
1957
1957
----
1958
1958
spring.datasource.initialization-mode=always
1959
1959
----
1960
+
1960
1961
In a JPA-based app, you can choose to let Hibernate create the schema or use `schema.sql`, but you cannot do both.
1961
1962
Make sure to disable `spring.jpa.hibernate.ddl-auto` if you use `schema.sql`.
1963
+
1962
1964
[indent=0,subs="verbatim,quotes,attributes"]
1963
1965
----
1964
1966
spring.jpa.hibernate.ddl-auto=none
1965
1967
----
1968
+
1966
1969
If you are using a <<spring-boot-features.adoc#howto-use-a-higher-level-database-migration-tool,Higher-level Database Migration Tool>>, like Flyway or Liquibase, you cannot use basic SQL scripts to create and initialize the schema.
1967
-
In this situation, if `schema.sql` and `data.sql` are present, they will be ignored. It is not possible to use a Database Migration Tool to manage schema creation, and a basic SQL script to initialize it.
1970
+
In this situation, if `schema.sql` and `data.sql` are present, they will be ignored.
1971
+
It is not possible to use a Database Migration Tool to manage schema creation, and a basic SQL script to initialize it.
1968
1972
====
1969
1973
1970
1974
By default, Spring Boot enables the fail-fast feature of the Spring JDBC initializer.
@@ -2063,8 +2067,8 @@ To automatically run Liquibase database migrations on startup, add the `org.liqu
2063
2067
2064
2068
[NOTE]
2065
2069
====
2066
-
When you add the `org.liquibase:liquibase-core` to your classpath, by default database migrations will run for both during application startup and before your tests run.
2067
-
This behavior can be customized by using the configprop:spring.liquibase.enabled[] property, setting different values in the `main` and `test` folders.
2070
+
When you add the `org.liquibase:liquibase-core` to your classpath, database migrations run by default for both during application startup and before your tests run.
2071
+
This behavior can be customized by using the configprop:spring.liquibase.enabled[] property, setting different values in the `main` and `test` configurations.
2068
2072
It is not possible to use two different ways to initialize the database (e.g. Liquibase for application startup, JPA for test runs).
0 commit comments