Today is birthday time! This blog turns one and Flyway turns 4! And to celebrate we are releasing our next major version: Flyway 3.0.

The hightlights of this major release are:

Breaking changes

Android and SQLite support

MariaDB support

Opening up for extension

Breaking changes

Flyway tries very hard to stay compatible between versions. But as all major versions go, this one marks a transition. We are leaving old things behind for a brighter future ahead.

flywaydb.org transition complete

The transition from Google Code to flywaydb.org and Github is now complete. Say goodbye to the old groupId and package name com.googlecode.flyway , and welcome org.flywaydb!

Simply update these and you should be good to go!

Dropped features

It's spring time and we have a major release, so it's time to prune some old cruft. In this release we removed:

Java 5 support: The baseline is now Java 6. Java 5 users must upgrade the JRE or stay with Flyway 2.3.

The baseline is now Java 6. Java 5 users must upgrade the JRE or stay with Flyway 2.3. Deprecated API: All deprecated properties and actions have been removed. The Javadoc in Flyway 2.X documents how to move to modern equivalents.

All deprecated properties and actions have been removed. The Javadoc in Flyway 2.X documents how to move to modern equivalents. Flyway 1.X metadata table format: Users upgrading from 1.X must upgrade to 2.3 first, then to 3.0.

Android and SQLite support

Flyway 3.0 brings solid database migrations to the Android platform. And it does so in a comprehensive way.

We started with SQLite support. Flyway now works with SQLite 3.7.2 and newer both on Android (4.0 and up) with the SQLDroid Jdbc driver and all the other platforms with the Xerial Jdbc driver.

We then integrated the Android logging system and made sure the classpath scanning works flawlessly too.

Making it work

Start by adding the SQLDroid driver jar to the libs directory

Then inside your main activity add this:

import org.flywaydb.core.Flyway; import org.flywaydb.core.api.android.ContextHolder; import android.database.sqlite.SQLiteDatabase; SQLiteDatabase db = openOrCreateDatabase("...", 0, null); ContextHolder.setContext(this); Flyway flyway = new Flyway(); flyway.setDataSource("jdbc:sqlite:" + db.getPath(), "", ""); flyway.migrate();

Now add your migrations to the assests/db/migration directory and you're done!

P.S.: And yes, we support Java-based migrations too!

MariaDB Support

Flyway has had MySQL support since 2010. We now built onto that foundation and added MariaDB support, including full support for the MariaDB Jdbc driver.

Opening up for extension

Users have been asking to be able to integrate more deeply with Flyway for a long time. We finally believe the core is now stable enough to open it up for extension in a way we can support for the future.

Lifecycle Callbacks

The first part we are opening up is lifecycle callbacks. You are now able to hook into all aspects of the Flyway lifecycle. This allows to perform whatever action you what when you want. This could be granting rights to all tables after all migrations complete, recompiling procedures, or whatever you need. You now get handed a connection within a transaction and you can use it to your liking. All you have to do is:

Implement the new FlywayCallback interface

Register it with Flyway.setCallbacks(...)

Custom Migration Resolvers

The second part we are opening up is migration resolvers. This is for people who need more than the standard SQL and Java migrations. It allows you to resolve and execute migrations in any way you want. This could be reading test data from csv files, integrating with version control for stored procedures, or simply having the possibility to execute some statement outside of a transaction (very useful when you need it).

To get started with this:

Implement the new MigrationResolver interface

Add a corresponding MigrationExecutor implementation

Register the resolver with Flyway.setResolvers(...)

And voilà!

The road ahead

These two extension points represent the beginning. We are extremely curious as to what extensions the community will come up with. We will keep a close eye on them and integrate some of the best ones in future releases.

You can also expect stronger build tool integration for these extensions in the future, so that you won't have to write Java code anymore to enjoy them.

Grab it!

Stability and reliability are always our top priority and this release is no exception. It packs a ton of fixes and small improvements across the board. You can find all the details are in the release notes.

Thank you to everyone who reported issues and sent in pull requests. Special thanks to Dan Bunker for the lifecycle callbacks.

Enjoy the release and get it while it's hot!

All users are encouraged to upgrade.

Feel free to share, tweet, post or comment in any way you like.