Take the 2-minute tour ×

:) Sorry for my English :(

I'm not a user of RoR, but I saw how friend of me programs :). He generates special files, that tracks changes in his database. After, He runs rake db:migrate and special utility applies changes to a database.

I study Java EE and I want to have the same functionality, because I need to develop my applications on different computers (at home, at my girl home, on a laptop, etc), so I wanna to have same files (with db changes) in VCS directory and apply them on different machines.

I know, that liquibase has that functionality, but I don't want to write XML-files for liquibase manually :(. For DB design I wanna use NetBeans or MySQL Workbench (or similar tools).

If it matters, I use Java EE 6, Netbeans 7.3, MySQL, Windows, MySQL Workbench. What is the best way for me to solve my problem? :)

share|improve this question
add comment

2 Answers

Take a look at FlyWay. It's a simple database migration tool/library. You write migrations in plain SQL. Compared to liquibase it's simpler (plain SQL vs XML) though a bit less flexible (you are tied to specific SQL dialect). http://flywaydb.org/

As for generating schema diff - (your comment on the other answer) I use Liquibase's diff command for that. It would print out differences between two schemas, however, it will not print out actual SQL needed to migrate from one schema to another. SQL can be generated using Liquibase though, however it's two step process (and was confusing for me when I first attempted to use Liquibase). You need to first generate changelog xml (using diffChangeLog command) and then convert the changelog xml to actual SQL commands (using updateSQL command).

In my projects that require db migrations I use FlyWay for actual migrations, hibernate to generate schema on the go from entity classes while in development and if there were many changes to the schema in a development phase, I use liquibase to generate a schema diff that I apply to a FlyWay migration script.

share|improve this answer
add comment

you could use MyBatis Schema Migrations, it's easy and powerful.

share|improve this answer
Thank you very much! Hmm, but, perhaps, is there any variants, that is integrated in Netbeans and can generate migration script that based on my Entity classes and current version of DB? –  Slava Mar 31 '13 at 9:14
add comment

Your Answer


