Jun  08
27
Fun with Liquibase

I started playing with Liquibase two days ago on June 24. I wanted to take advantage of Liquibase’s ability to generate database schema upgrade DDLs given an existing database and Hibernate mapping files. This capability was new in Liquibase 1.6. I downloaded version 1.6.1 on June 24.

My ultimate goal was to integrate Liquibase into our Ant-based build system, so I started exprimenting with Liquibase’s Ant tasks, specifically diffDatabaseToChangeLog and updateDatabase. The diffDatabaseToChangeLog task kept complaining about not finding the Hibernate mapping file, so I switched over to Liquibase command line interface hoping for more luck. After a few hours of tinkering, including changing command line’s CLASSPATH environment variable and liquibase.bat’s CP variable to include the path to hibernate file, I managed to generate a Liquibase change log. Along the way I realized that Hibernate file needed to be in the CLASSPATH to be visible to Liquibase.

[Continue Reading]