在生产中有数据库时编辑实体
Edit entity when have a database in production
我在 7 月份用 jhipster 创建了我的应用程序,我已经将它投入生产。
现在我需要编辑一个实体。
当我使用 jhipster entity
子生成器更新实体的初始 xml 生成时,但这不是正确的工作,代码需要创建一个新的 xml 并更新如下:mvn liquibase:diff
在网上搜索我发现了这个答案:Add new field to existing entity with JHipster。在某个时刻用户说:
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.
参考最后一句,是真的吗? Jhipster entity subgenerator 不支持数据库更新,只支持初始创建?
谢谢
是的,没错。
要么您编写手动 Liquibase 迁移,要么使用 liquibase:diff 来帮助您完成此过程。
查看官方文档:https://www.jhipster.tech/development/#database-updates-with-the-maven-liquibasediff-goal
我在 7 月份用 jhipster 创建了我的应用程序,我已经将它投入生产。
现在我需要编辑一个实体。
当我使用 jhipster entity
子生成器更新实体的初始 xml 生成时,但这不是正确的工作,代码需要创建一个新的 xml 并更新如下:mvn liquibase:diff
在网上搜索我发现了这个答案:Add new field to existing entity with JHipster。在某个时刻用户说:
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.
参考最后一句,是真的吗? Jhipster entity subgenerator 不支持数据库更新,只支持初始创建?
谢谢
是的,没错。
要么您编写手动 Liquibase 迁移,要么使用 liquibase:diff 来帮助您完成此过程。
查看官方文档:https://www.jhipster.tech/development/#database-updates-with-the-maven-liquibasediff-goal