Add new field to existing entity with JHipster

前端 未结 1 1388
庸人自扰
庸人自扰 2021-01-06 07:14

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,

相关标签:
1条回答
  • 2021-01-06 07:22

    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.

    0 讨论(0)
提交回复
热议问题