如何更新现有表JHipster示例应用程序? [英] How to update existing table JHipster sample app?

查看:85
本文介绍了如何更新现有表JHipster示例应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创建时已使用命令 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的文档.

这篇关于如何更新现有表JHipster示例应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆