如何更新现有表JHipster示例应用程序? [英] How to update existing table JHipster sample app?
问题描述
我在创建时已使用命令 yo jhipster:entity event 创建了一个名为" event "的实体,但我忘了添加一列,例如" event_title ",因此,我在liquibase changelog xml中手动添加了this(event_tile)列.现在如何使用新添加的列更新事件表?
I have created an entity called "event" using command yo jhipster:entity event while creating I forgot add one column let's say "event_title" so, I have added this(event_tile) column manually in liquibase changelog xml. Now how to update event table with newly added column?
推荐答案
您需要在src/main/resources/config/liquibase/master.xml
文件中包括新的变更日志文件.
You need to include the new changelog file in your src/main/resources/config/liquibase/master.xml
file.
<include file="classpath:config/liquibase/changelog/my_new_changelog.xml"
relativeToChangelogFile="false"/>
下次运行该应用程序时,将应用更改.
Next time you run the app, changes will be applied.
您还可以使用以下maven任务更新数据库:
mvn liquibase:update
.
You can also update the database with the following maven task :
mvn liquibase:update
.
这篇关于如何更新现有表JHipster示例应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!