问题
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 yourpom.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