Rick GZ Rick GZ - 1 year ago 153
Java Question

How does production database creation work in Jhipster?

Having some issues when uploading my jhipster generated app to heroku, after some research I found out that some entity modifications I did while developing are not done in production db so some fields are missing.

I also added a field to User entity, so now I cannot even register/login while that field is missing from the table.

Would like to know how exacly the database generation works in prod mode so I can make it work. Could it be related to smth missing in liquibase changelog?(I'm absolutely new to liquibase so I'm a bit lost).


The problem seems to be a missing column from "jhi_user" table. I need to create a database changelog to add that missing column, so I ran
"mvn liquibase:generateChangeLog"

I saw the correct changelog poping in the console, but no changelog was created under my changelogs folder. What am i doing wrong?

Answer Source

The problem was changelogs were not beeing generated when i created entities from yo jhipster:entity command.

Solved the issue doing:

mvn liquibase:diff

Plus some hand-done changesets and adding them to master.xml.

After that:

mvn liquibase:dropAll
mvn liquibase:update

Then deployed to heroku and every table was created.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download