Search code examples
javaspringspring-boothsqldbliquibase

HSQL DB lost when spring-boot app restarts


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?


Solution

  • in application.properties, set this property:

    spring.jpa.hibernate.ddl-auto = validate
    

    source and more info.