1

Jhipster creates a initial project structure for us, but normally there changes in an active application, like a new entity, a new relationship or any field modification. All changes modify the initial database.

What is the recommended way to modify a existent database? Because in my tests using Postgresql and not H2 I need to drop the existent database and create it again for changes to take effect because JHipster modifications doesn't create a new Liquibase changelog, it replaces the existing one with the changes, causing the migration to fail on the next start of the appplication due to differences in the db schema and the changelogs.

renanvm
  • 208
  • 3
  • 16
  • 2
    Does this answer your question? https://stackoverflow.com/questions/43207163/jhipster-liquibase-validation-error-after-modify-entity – htshame Jan 20 '20 at 12:48
  • 1
    Have you looked at the JHipster docs? https://www.jhipster.tech/development/#database-updates – Gaël Marziou Jan 20 '20 at 13:33

1 Answers1

0

If you work on not empty database you can create the corresponding changelog for your entities via the command line::

liquibase --changeLogFile=dbchangelog.xml generateChangeLog

After the ChangeLog is created you can include it in your project.

sudo
  • 747
  • 6
  • 19