LiquiBase, the database refactoring/migration tool, has had a busy year. Building on the momentum of the 1.0 release in June, with support for test contexts, thirty refactorings, four of the most common relational databases, automatic rollback and distributed development, LiquiBase added two more minor releases and some point releases, which address:
- Support for DB2, Derby, Sybase, HSQL, H2, InterSystems Cache, and 'unsupported' databases
- A database 'diff' tool for comparing databases against a known schema and generating migrations
- New commands to verify and check the status of your changelog
- An eclipse plugin to add support for database refactoring into eclipse
The eclipse plugin has a companion screencast/demo that shows the eclipse plugin in action, generating and applying database changes.
In addition, the LiquiBase blog has covered:
-
Evolutionary Database Design:
For now, however, we need to start a the simple end and build a strong foundation of tools and techniques before working our way up the stack to the top. There is the start of the required tools in the form of DBUnit for unit testing and LiquiBase for managing refactorings, but there is still large holes including IDE support for refactorings, best practices and pattern catalogs for database testing, and more.
-
The Problem with Rails Active Migrations:
The fundamental problem is that Rails tracks the "database version" as a single incrementing integer. That works fine when only one developer is adding migrations and when there is only one branch. When you add developers and branches, however, you quickly run into problems with duplicated version numbers, and missed migrations because the production "database version" is higher than a newly merged in migration.
-
Building Database Tests that Don't Break and Unit Testing the Database Access Layer:
To solve the problem of keeping test data definitions from getting out of sync with the schema, you need to have your test data built up along with your database so it will be modified by database refactoring that were made after it was initially created.
For more information about LiquiBase and other database tools for your Java project, stay tuned to InfoQ.
Community comments
Diffs, Scriptella
by Geoffrey Wiseman,
Re: Diffs, Scriptella
by Nathan Voxland,
Re: Diffs, Scriptella
by Fyodor Kupolov,
Liquibase rocks
by Jason Carreira,
Diffs, Scriptella
by Geoffrey Wiseman,
Your message is awaiting moderation. Thank you for participating in the discussion.
Diffs came up a lot in the last set of comments about LiquiBase; does the diff support now available cover off those questions?
Also, a few people mentioned Scriptella last time; has anyone has a chance to compare the two in detail?
Liquibase rocks
by Jason Carreira,
Your message is awaiting moderation. Thank you for participating in the discussion.
I put Liquibase into my build after seeing the 1.0 announcement a few months back... I find it much easier to manage than the hand-written SQL I had before, and that was even before the niceties like building the XML for you or doing database diffs.Good stuff!
Re: Diffs, Scriptella
by Nathan Voxland,
Your message is awaiting moderation. Thank you for participating in the discussion.
I believe that the diff support does cover all the earlier questions. It allows you to compare schema differences between two databases (even of different types, to some degree) and will either generate a report of the differences or generate a change log to resolve any differences (which can output the actual SQL if required).
The 1.3 release should be out in a couple days and adds some additional diff functionality including checking column types and nullability as well as comparing view definitions.
Other upcoming 1.3 changes include: specifying multiple contexts per
change set, a "custom" tag that lets you easily plug in your own custom refactorings, a database change documentation generator, and more.
Re: Diffs, Scriptella
by Fyodor Kupolov,
Your message is awaiting moderation. Thank you for participating in the discussion.
Scriptella was designed for ETL and database migrations based on SQL. In my view Scriptella and LiquiBase compares to each other like iBatis to Hibernate. If you prefer a manual way to describe migrations using SQL I'd recommend to use Scriptella (iBatis for ORM), otherwise LiquiBase would be a better choice.