Hibernate diff generates pointless dropIndex/createIndex (and addForeignKeyConstraint)

Hi guys,

Bearing in mind http://forum.liquibase.org/#topic/49382000000025593 where Nathan said in 2009 that he was planning better Hibernate support in 2.1…

I just downloaded liquibase 2.0.1-bin.tar.gz and liquibase-hibernate-2.0.0.jar and got them working.

For a simple initial test case, am wanting to use liquibase to track the addition of a single attribute to one of my Entities, which requires a new column in one table.

I created my database schema fairly recently by using the hbm2ddl create-drop mode, so I’m pretty sure it’s a good match for the various annotations used in my Entity classes.  I have since removed the hbm2ddl line from hibernate.cfg.xml so it’s no longer an issue.

I’ve now run a “diffChangeLog” command using liquibase and generated a changelog.xml, which contains way more changes than I expect.  Specifically, there is:

1 the “addColumn” that I expect for a new attribute on one of my Entities.
2 a “createIndex” change for almost every indexed column.
3 a “dropIndex” change for almost every original index on indexed columns.
4 a “addForeignKeyConstraint” for what looks like every Entity.

‘1’ is expected. ‘2’ and ‘3’ seem to be a waste of time and I do not expect them to be generated.  ‘4’ is possibly because I’m using the MySQL MyISAM engine which I believe doesn’t support foreign key constraints, so although the Hibernate mappings would try to apply them, they cannot actually stick in the database, so liquibase doesn’t see them and thinks they need re-creating.

So my main question is, are these problems expected, and should I therefore either give up on liquibase’s hiberate integration for now, or at least treat it as requiring a great deal of manual manipulation of the diffChangeLog output before using it?  (i.e., just use the “1” “addColumn” that I know I want)

If the situation is even worse than I think, would you recommend I give up on diffChangeLog for Hibernate integration and write my change sets by hand?

And… that post from 2009 makes me believe that development on these features hasn’t moved forward.  What’s the current state, and is it worth considering working from trunk?  I did fetch trunk from SVN and ran with it, but got similar results.

Point me at the relevant post if I’ve simply missed these questions answered elsewhere :slight_smile:

Thanks
Nick