Reputation: 33
we need to reset our h2 database using jhipster in dev mode (start from scratch) at each restart. Which is the correct way?
Upvotes: 1
Views: 1967
Reputation: 1073
I'm assuming you chose the "H2 Database with Disk-based persistence" option when creating your JHipster application. If that is the case, Cristian's solution should work just fine, just make sure you never run your app in dev mode against a database that you don't want to be deleted.
In the future, you can choose the "H2 In-Memory Database" option when creating a JHipster application. With this option selected, you will always get a brand new database in dev mode, since the database is held in memory only.
Upvotes: 1
Reputation: 136
Simply add the spring/liquibase/drop-first
parameter and set it to true
in your application-dev.yml
file under src/main/resources/config/
like so:
(...other parameters...)
liquibase:
contexts: dev
drop-first: true
(...other parameters...)
Upvotes: 3