How to upgrade an existing JHipster application for a table?

I created an object called " event " using the yo jhipster: entity event command when creating. I forgot to add one column, say: event_title "So, I added this column (event_tile) manually in the changelog linml file. Now, how to update the event table with the added column?

+4
source share
2 answers

You need to include the new change file in the file src/main/resources/config/liquibase/master.xml.

<include file="classpath:config/liquibase/changelog/my_new_changelog.xml" 
    relativeToChangelogFile="false"/>

The next time you start the application, the changes will be applied.

You can also update the database with the following maven tasks: mvn liquibase:update.

doc jhipster .

+3

src/main/resources/config/liquibase

:

<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">

<changeSet author="lazaro" id="altertable-02">
    <addColumn catalogName="mySchema"
            schemaName="public"
            tableName="myTableName">
        <column name="atributeName" type="bigint"/>
    </addColumn>
</changeSet>

src/main/resources/config/liquibase/master.xml

A include tag:

<include file="classpath:config/liquibase/changelog/add_column_quantity_entity_Item.xml" relativeToChangelogFile="false"/>
+2

All Articles