Skip to end of banner
Go to start of banner

Manage Database Changes

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

This section describes how custom database changes can be made, defining those changes in XML files rather that writing SQL directly against the database.

 

What does this section cover?

 

Create New Table

 

projectname.changelog.xml
<databaseChangeLog>
	...
	<changeSet author="custom_developer" id="custom-db-change-1">
		<createTable tableName="CUSTOMTABLE">
            <column name="CUSTOMID" remarks="Primary Key" type="VARCHAR(32)">
                <constraints nullable="false"/>
            </column>
            <column name="CUSTOMNAME" remarks="The name of the custom entity" type="VARCHAR(256)"/>
            <column name="CUSTOMALTCODE" type="VARCHAR(32)"/>
            <column name="CUSTOMDESC" remarks="The description of the custom entity" type="VARCHAR(512)"/>
            <column name="CUSTOMCREATEDDATE" type="TIMESTAMP"/>
            <column name="CUSTOMUPDATEDDATE" type="TIMESTAMP"/>
            <column name="CUSTOMDELETED" type="INTEGER"/>
            <column name="CUSTOMCREATEDBYUSERID" type="VARCHAR(32)"/>
            <column name="CUSTOMUPDATEDBYUSERID" type="VARCHAR(32)"/>
            <column name="CUSTOMCREATEDBYOUUID" type="VARCHAR(32)"/>
            <column name="CUSTOMUPDATEDBYOUUID" type="VARCHAR(32)"/>
            <column defaultValueNumeric="0" name="RECVERSION" type="INTEGER">
                <constraints nullable="false"/>
            </column>
        </createTable>
	</changeSet>
	...
</databaseChangeLog>
  • No labels