HSQL DB lost when spring-boot app restarts

2019-07-27 12:27发布

I'm using liquibase to initialize my db in my springboot app and it works fine until I restart - the db is re-initialized wiping all the data.

Here are my application properties

# Liquibase
liquibase.change-log=classpath:/db/changelog/iot-db.xml
liquibase.check-change-log-location=true

# Hibernate
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.show_sql=false
hibernate.hbm2ddl.auto=
entitymanager.packagesToScan=com.whatever

Are there properties which will allow me to create a persistent db instead of an in memory db?

1条回答
女痞
2楼-- · 2019-07-27 12:46

in application.properties, set this property:

spring.jpa.hibernate.ddl-auto = validate

source and more info.

查看更多
登录 后发表回答