user1260928
user1260928

Reputation: 3429

jhipster liquibase doesn't update database

I m trying to add a new entity, I don't use the full hot reload, so I created a db-changelog-002.xml file with the new table to be created in the changeset of the file. Then I ran a mvn spring-boot:run, but my database doesn't get updated with the new table. Is it normal?

Thank you in advance.

Upvotes: 3

Views: 11114

Answers (5)

Muhammad Abdullah Aqib
Muhammad Abdullah Aqib

Reputation: 171

  1. Make sure to <include> in master.xml.
  2. Make sure to check LOCKED column in table databasechangeloglock. If locked then unlock it.
  3. Make sure to add database information in pom.xml under liquibase-maven-plugin.
  4. Sometimes JHipster doesn't update the Database even though everything is perfectly fine. In that case, you can forcefully update your Database by running this command mvnw -X liquibase:update

Upvotes: 1

Eduardo Toural
Eduardo Toural

Reputation: 79

  1. check in the pom.xml file the database setup under the liquibase-maven-plugin artifact, make sure the (url, username, password, etc.) are fine
  2. run mvn liquibase:diff to create the "new_changelog.xml" file
  3. <include> the "new_changelog.xml" in the master.xml, check the date-time of the file to be sure that it was correctly created
  4. run the application again

...then cross your fingers, and with a bit of luck the tables will be created !!!

Upvotes: 1

Mohamed
Mohamed

Reputation: 864

I must configure the liquibase database information in your pom.xml file

Upvotes: 0

Charnjeet Singh
Charnjeet Singh

Reputation: 3107

No Need to create another db-changelog-002.xml file.just add another change set in our Db-ChangeLog.xml file.It will work fine for you.

Upvotes: 2

magic_dev
magic_dev

Reputation: 1429

You must add your file to master.xml file, like below.

<include file="classpath:config/liquibase/changelog/db-changelog-002.xml" relativeToChangelogFile="false"/>

Upvotes: 7

Related Questions