jhipster liquibase doesn't update database

[亡魂溺海] 提交于 2020-01-13 16:24:11

问题


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.


回答1:


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

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



回答2:


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.




回答3:


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




回答4:


  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 !!!



来源:https://stackoverflow.com/questions/22691455/jhipster-liquibase-doesnt-update-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!