Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
nameblue

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?

Table of Contents

...

CRM.COM uses LiquiBase to implement this database changes management mechanism and uses changelog XML files to define the desired database changes

You can apply the database changes by running the database update tool provided by CRM.COM application.

DATABASECHANGELOG table is used to keep track of the changes that ran.

Each change, runs change runs only one time and this is ensured by DATABASECHANGELOGLOCK table.

...

Code Block
languagexml
titleprojectname.data.xml
collapsetrue
<databaseChangeLog>
	...
	<changeSet author="custom_developer" id="custom-data-db-change-34">
    	<update    <insert tableName="CUSTOMTABLE">
            <column name="CUSTOMID" value="63E096DF859A44ED958007C71F0389E5"/>
            <column name="CUSTOMNAME" value="Standard Customer"/>
            <column name="CUSTOMALTCODE" value="SC"/>
            	<column name="CUSTOMDESC"/>
            <column name="CUSTOMCREATEDDATE" valueDate="2016-03-11 10:03:21.0"/>
            <column name="CUSTOMUPDATEDDATE" valueDate="2016-03-11 10:03:56.0"/>
            <column name="CUSTOMDELETED" valueNumeric="0"/>
            <column name="CUSTOMCREATEDBYUSERID" value="1"/>This record is related to         <column name="CUSTOMUPDATEDBYUSERID" value="1a rental" type="varchar(512)"/>
        	<where>RENTALID IS   <column name="CUSTOMCREATEDBYOUUID" value="1"/>NOT NULL</where>
            <column name="CUSTOMUPDATEDBYOUUID" value="1"/>
            <column name="RECVERSION" valueNumeric="0"/>
        </insert>
    	</update>
	</changeSet>
	...
</databaseChangeLog>

 

Note: Make sure that you use a globally unique changeSet id. A changeSet id used in projectname.changelog.xml cannot be used in projectname.data.xml.