A sample liquibase set-up using JSON
Here's a very basic set-up guide to get going with liquibase in Ubuntu 14.04 3.13.0-79-generic
sudo apt-get install openjdk-7-jre
sudo mkdir -p /usr/local/liquibase
cd /usr/local/liquibase
sudo wget https://github.com/liquibase/liquibase/releases/download/liquibase-parent-3.4.2/liquibase-3.4.2-bin.tar.gz
sudo tar -xvf liquibase-3.4.2-bin.tar.gz
sudo rm liquibase-3.4.2-bin.tar.gz
sudo ln -s liquibase /usr/bin/liquibase
cd ~/
git clone https://github.com/willitscale/SampleJsonLiquibase.git
cd SampleJsonLiquibaseYou will need to either set-up a database server locally or have a remote database access available. This example is assuming that your dbms is MySQL with the username 'admin' and password 'password' and you will have to adjust the liquibase.properties to reflect your set-up. If you require any additional drivers I would suggest oracle-jdbc.
Tags the initial structure as your "base" or starting point.
liquibase tag "base"Each update should execute the defined changes and then tag the changes as outlined.
Creates the table 'person' in 'test' and tags the structure as 'TEST-1000'
liquibase --changeLogFile=changes/TEST-1000/changeSet.json updateAlters the 'person' table with the additional field 'lastname' and tags the structure as 'TEST-1001'
liquibase --changeLogFile=changes/TEST-1001/changeSet.json updateImports data to the 'person' table and tags the structure as 'TEST-1002'
liquibase --changeLogFile=changes/TEST-1002/changeSet.json updateDrops all the data from the 'person' table and reverts to the tag 'TEST-1001'
liquibase --changeLogFile=changes/TEST-1002/changeSet.json rollback "TEST-1001"Drops the 'lastname' column and reverts to the tag 'TEST-1000'
liquibase --changeLogFile=changes/TEST-1001/changeSet.json rollback "TEST-1000"Drops 'person' table and reverts to the tag 'base'
liquibase --changeLogFile=changes/TEST-1000/changeSet.json rollback "base"