Liquibase 2.0 Officially Released
At long last, Liquibase 2.0 has been released. For those of you watching closely, you know that 2.0.0 was actually released December 19th, but I wanted to give it a couple weeks (and a 2.0.1 release) before making the official announcement. Liquibase 2.0 has been a long time coming, but I am very proud of it. The most recent version (now 2.0.1) is available from the download page along with the v2.0 upgrade guide.
With version 1.9, Liquibase had hit the point where it had a growing user base and 90% of the functionality that developers needed to manage their databases. As I was looking at what to add for version 1.10, it was becoming clear that everyone wants a different (and often contradicting) final 10%. One team wants CLOBS to match to a UTF-8 compliant datatype, another wants them to be full text indexable. One team wants logging using slf4j, another wants log4j. And don’t forget the biggest war of all: XML changesets vs. the XML-haters. Add to this a tool with complex (and sometimes confusing) functionality and there were two obvious requirements for the future of Liquibase: Extensibility and Community.
Extensibility
Feature-wise, the biggest change with Liquibase 2.0 is the new extension system. The goal of the Liquibase extension system is to allow end users to modify and mold Liquibase to suite their particular development needs. While 1.9 and before included features like custom change classes,
Now, if you don’t like that the generated CREATE TABLE SQL does not include “ENGINE=INNODB”, you can create a subclass of CreateTableGenerator to modify it. If you would rather use a different logger you can create a subclass of AbstractLogger. If you don’t like XML, you can write a new changelog parser (there are now groovy, scala, and clojure versions underway).
The general pattern for all extensions is to create a subclass for an existing Liquibase class or interface and override the public void getPriority() method. At runtime, Liquibase will find all classes that implement a given class/interface and choose the one with the highest value from getPriority(). Registering your extension only requires you to put your class in a sub-package of liquibase.ext.
Community
Although there is often conflicting requirements behind extensions, there is also many groups that need the same problems solved. To help facilitate the sharing and development of Liquibase extensions, we have created the Liquibase Extension Portal where anyone can post and share extensions they have created, including using our subversion and/or bug tracking if needed.
Beyond the extension portal, there have been several other “improve the Liquibase community” changes since 1.9 was released, including:
- Replacing the mailing lists with a forum system
- Changed from LGPL license to the more permissive Apache 2.0 license
- Switched to Jira for bug and feature tracking
- Introduced an official Liquibase training and support channel
- Moved SVN for better source browsing and Jira integration
- Created an announcement mailing list/newsletter (see http://liquibase.org sidebar to subscribe)
- Major code refactoring/simplification effort to make a smaller learning curve to contributing code
But Wait, There’s More!
Beyond the big goals of extensibility and community (and the bug fixes), there is also important new functionality in the core Liquibase library including:
- SQL-based Changelogs
- Informix support
- Ability to specify target changelog parameters to particular databases and/or context
- Ability to specify target modifySql to particular contexts
- Expanded use of changelog properties, including in preconditions and SQL text
- Performance improvements
The Future
With the official release of Liquibase 2.0, the plan is to go back to a more standard release schedule. That means that 2.1 will not take 2 years… The jump from 1.9 to 2.0 had a lot of pieces to move around but the primary reason for the long release schedule was ensuring that the internal Liquibase API will be stable going forward for end users to code extensions against without fear of breaking changes.
Going forward, Liquibase development will be broken into two areas: work on the core library and work on extensions. While the extension system is great for end users, it will also help us to build deeper support for particular databases without trying to force database-specific functionality into the main library, iterate new and experimental features independently of the main library, and add take advantage of 3rd party libraries without adding a required dependency for everyone. This will allow the core Liquibase library to be better focused on providing a solid feature-set that is common to all databases and users.
I have already began some work on 2.1 which is primarily targeted at improving the database diff support which will allow the hibernate integration to improve as well as changelog generation for existing databases. Work beyond 2.1 will, like usual, be driven by user request. I would like to get back to the .net and Liquibase IDE proof-of-concepts I had began as well. There is also additional community improvements I would like to investigate including a less spam-attracting forum and possibly moving from SVN to github.
As always, let us know if you have any questions or suggestions, and thanks to everyone that contributed code, bug reports, and help during the 2.0 development.
Tweets that mention Liquibase » Blog Archive » Liquibase 2.0 Officially Released -- Topsy.com:
[...] This post was mentioned on Twitter by Paul Bourdeaux, Laird Nelson and Shantanu Kumar, Nathan Voxland. Nathan Voxland said: Liquibase 2.0.1 release. 2.0 officially announced http://bit.ly/ekvcI0 [...]
27 January 2011, 3:06 pmErwin van Brandwijk:
I’m doing research for 42 as an intern. I’m looking for the best Database Migration Tool for this company.
After researching 12 tools, Liquibase and Ruby Migrations came out as best.
Liquibase has a perfect structure and it’s possible to make your own classes. But the migrations are in XML.
That’s where Ruby Migrations comes in. This company likes the dynamic language.
So my question is, how is the development of the groovy changelog parser going?
Quote “If you don’t like XML, you can write a new changelog parser (there are now groovy, scala, and clojure versions underway). ”
My “boss” said that if liquibase had groovy migrations, it will win, no doubt!
2 February 2011, 5:39 amNathan Voxland:
There is a groovy DSL as part of the Grails Database Migrations plugin (see http://blog.liquibase.org/2011/01/new-standard-liquibase-plugin-grails-database-migration.html) which uses liquibase as the base library and adds additional features on top of it.
2 February 2011, 3:45 pmErwin van Brandwijk:
Thank you, link is wrong but i went to the correct page.
Not a lot of documentation and help, but the plug in works great.
7 February 2011, 5:20 amDavid Jantzen:
Congrats Nathan, great to see it finished — just in time for my new project too
Thank you!
8 February 2011, 7:25 pmMaven Tip: Disabling Profiles when a Property Does Not Exist « Early and Often:
[...] In regards to the Liquibase Maven plugin, a feature was added to allow property based skipping. This is only available as of Liquibase 2.0. [...]
9 February 2011, 11:18 amErwin van Brandwijk:
I’m done with researching, it’s now time to implement my solution.
We tried to use the grails plugin. But it’s connected to a grails project.
We dont want a grails project in deployment.
Example: Ruby migrations only needs config files, rake file and the migration files.
So my question is; are you integrating groovy migrations in core Liquibase? or did we miss a good solution from the plugin?
18 February 2011, 4:14 amNathan Voxland:
@Erwin, I don’t do any grails development myself, so I don’t know what it would take to use the grails liquibase plugin outside of grais. I will not bring groovy migrations into the core liquibase library, it will stay an extension, but it is certainly possible to write support for changelogs in any format (including a groovy-ish DSL) without relying on any other technologies.
You could look at https://github.com/tlberglund/groovy-liquibase which is/was a separate groovy DSL from the version that got built into the official grails db migrations plugin. That one may be less grails centric, I’m not sure. I also don’t know if it will continue to be developed or not, now that there is grails-db-migrations.
20 February 2011, 6:06 pmErwin van Brandwijk:
Thanks for your reply, I thought it was coming in the core version.
21 February 2011, 7:10 amAdinarayana:
hi, thank for this jar
i am using your jar in my java.
it is working good. but i faced few problems.
I am diffing and get the differences. when i am updateing missing primary key in target data base if it is a composite key i am unable to create that composite key.
thanks,
25 May 2011, 3:20 amAdinarayana.
Primo:
Great stuff!
13 August 2011, 7:05 am