Add new field to existing entity with JHipster

喜欢而已 提交于 2019-12-06 04:28:11

问题


I've a problem when I try to add a new field to an existing entity. I run this command yo jhipster:entity Libro and I choose [BETA] Yes, add more fields and relationships, but when I try to compile my project with ./mvnw I receive this error http://pastebin.com/SW1kpeDT

I also try to follow the guideline in jhipster site but I have the same error.


回答1:


It's normal (at least in beta) because the update operation changed the Liquibase migration file 20161022122700_added_entity_Libro.xml that created the entity, so Liquibase compares the checksum of the updated file with the checksum that was recorded in your database when migration was first run before update.

So you have these alternatives:

  • create a new migration file to add only the new column (see addColumn documentation), revert the creation migration to its original content using git, run your app to apply changes to your database. This is what you would do when your app is in production.
  • clear the checksums by hand in databasechangelog table of your database(s)
  • run mvn liquibase:clearCheckSums command against your database(s). Make sure your pom.xml includes correct configuration for maven-liquibase-plugin to access your db.
  • use H2 in memory as dev database

As this feature is beta, this issue is probably going to be addressed.



来源:https://stackoverflow.com/questions/40328840/add-new-field-to-existing-entity-with-jhipster

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