spring.jpa.hibernate.ddl-auto=
create, create-drop, validate, and update
spring.jpa.hibernate.ddl-auto=
create, create-drop, validate, and update
spring.jpa.hibernate.ddl-auto
59.2 Initialize a database using Hibernate
You can set spring.jpa.hibernate.ddl-auto explicitly and the
standard Hibernate property values are none, validate, update, create-drop.
Spring Boot chooses a default value for you based on whether it thinks
your database is embedded (default create-drop) or not (default none).
An embedded database is detected by looking at the Connection type: hsqldb,
h2 and derby are embedded, the rest are not. Be careful when switching from
in-memory to a “real” database that you don’t make assumptions about the
existence of the tables and data in the new platform. You either have to
set ddl-auto explicitly, or use one of the other mechanisms to initialize
the database.
In addition, a file named import.sql in the root of the classpath will be
executed on startup. This can be useful for demos and for testing if you
are careful, but probably not something you want to be on the classpath in
production. It is a Hibernate feature (nothing to do with Spring).
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us