I recently used the liquibase
change set to generateChangelog
, diff
and updateSQL
to create the change log, to find the difference and to generate the ddl scripts respectively.
And my change log looked something like this and it was an xml file
<?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.1.xsd">
<changeSet author="John (generated)" id="1439225004329-1">
<createTable tableName="Author ">
<column autoIncrement="true" name="id" type="BIGINT">
<constraints primaryKey="true"/>
</column>
<column name="name" type="VARCHAR(255)"/>
</createTable>
</changeSet>
</databaseChangeLog>
I created this xml manually. And I was trying to create the same change log though java code. I am having an hard time figuring out how to do this in java. Can someone put some light on this?
I have added liquibase 3.5.5
as maven dependency
to my project.