users@glassfish.java.net

Re: Enterprise Application Preserve Data on Entity Changes

From: Paul <paul_at_nosphere.org>
Date: Fri, 20 Mar 2009 14:03:44 +0100

Suyog,

Le vendredi 20 mars 2009 12:53:27, glassfish_at_javadesktop.org a écrit :
> Thanks a lot Paul for the information.
> I found some very useful information about Liquibase over here
> http://www.oneadam.net/?p=27
Nice writeup.

> I am not sure, how efficiently this tool will work, if their are drastic
> and huge changes in the database schema. ( I am referring to changes like:
> Say an entity bean is modified to drop @ManyToMany relationship and add a
> new @OneToMany relationship etc.)
Liquibase provide IDE integration, at least for Eclipse and IDEA.
I do not use it, I prefer to keep the schema under control and write changeset
by hand.

> For some reason I am getting inclined towards using Logical Data
> Export/Import.
>
> Pros: No risk of loosing data or corrupting production data.
>
> Cons:Lot of efforts will be wasted, in modifying/implementing the Import
> logic every time the schema is modified.
If the schema evolution is big and affect data, nothing will prevent the need
of a custom "Migrator".

> It will be very helpful if you can add some more information:
> 1) I am not sure how robust the Liquibase tool is at moment. Have you seen
> use of Liquibase in Production Applications?
Grails based apps use liquibase under the hood to handle database migrations.
At my shop we use liquibase tools during development to migrate databases, we
use it to generate SQL code that is reviewed before being applied to
production databases.
There certainly is other people using it in production systems.

> 2) Can this tool handle complex database schema changes?
Here is what liquibase support : http://www.liquibase.org/refactorings

/Paul