martes, 17 de junio de 2008

Java Hibernate Migrations

Inspired by a post by Hari in one of his posts he mentions database migration tools and I took a look at the ones he mentioned, specially Liquibase and migrate4j.

I also found an alternative I was more attracted to Java DB Migrations because of its simplicity and possibilities to interface to my selected persistence framework: hibernate.

Roughly the steps I am thinking of are:

  1. Do most of the Object Model to be persisted in Hibernate Annotations
  2. Fine tune in Hibernate XML files
  3. Generate the initial DDL using Hibernate
  4. Fine tune that DDL manually to make it the initial (001) migration
  5. Continue maintaining DDL in parallel to your hibernate code
  6. If you ever need to migrate to a different database, use the sql migration code as a base line
I would very much like to hear if anyone knows about a Hibernate (3) migrations framework that you like as this is a kind of a patch I found.

Have fun!

No hay comentarios: