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 楼

这是正常的(至少在beta中是这样),因为更新操作更改了创建实体的Liquibase迁移文件20161022122700_added_entity_Libro.xml,因此Liquibase会将更新文件的校验和与在更新之前首次运行迁移时在数据库中记录的校验和进行比较。 br />
因此,您有以下选择:


创建新的迁移文件以仅添加新列(请参见addColumn文档),将创建的迁移还原为原始内容使用git,运行您的应用以将更改应用于数据库。这是在应用程序投入生产时要做的事情。
手动清除数据库的databasechangelog表中的校验和
对数据库运行mvn liquibase:clearCheckSums命令。确保您的pom.xml包含正确的配置,以便maven-liquibase-plugin可以访问您的数据库。已解决。

评论


If I try to use liquibase clearCheckSums I run in this error pastebin.com/ZhhXfveS. I also try your first advice but I have the same error. I don't know why but I'm not able to add new field to existing entity. WAIT: What are the correct step to follow your first advice. I make a new migration file and I copy all the contents of the original migration file in second and I add the new field, and after?

– Dennis
Oct 30 '16 at 13:56



第一步有问题。是否有逐步指导?这一点对我来说还不清楚“使用git将创建迁移还原为其原始内容”

–丹尼斯
16-10-30在14:29



git reset --hard config/liquibase/changelog/20161022122700_added_entity_Libro.xmlmay work, check changes applied to the chnagelog folder

– Gaël Marziou
Oct 30 '16 at 15:12

我可以在内存H2和开发数据库中找到它吗?

–powder366
17年11月23日在21:34



现在看来这似乎不起作用jdbc:h2:tcp:// localhost:9092 / mem:db; DB_CLOSE_DELAY = -1; MODE = MySQL无法看到应用程序表

–powder366
17年11月23日在22:28