2.0.0 / 2.0 RC7 � generateChangeLog miss AutoIncrement

Hello,

I’m working on a project using Hibernate as DLA. I first test my application using embedded Hibernate in-memory engine then I create the MySQL “crebas” XML file to get Liquibase deploy it on server.

I noticed some issues as in Hibernate I got a table with “native generator” which is deployed by Hibernate as autoIncrement in MySQL but Liquibase export Hibernate stuff as standard primary key. Once Liquibase deployed crebas, my attribute is not autoIncrement.

Is the problem due to Liquibase dialogue with Hibernate ?
Or due to Hibernate not telling the autoincrement stuff (Hibernate should tell he is generating an autoincrement, or maybe it is the mysql.driver that automatically understands this critical point).

Please help!

It looks like the current hibernate integration code does not check for native generator columns correctly to tell liquibase that the column should be auto-increment.

Until the check for that can get in, you will have to modify your changeset to add the auto-increment flag manually before running it against mysql.

Nahtan

Hi!

Thanks for the answer. I did so.

The strange point is that Hibernate creates the MySQL DB with auto-increment option correctly set. I supposed the issue comes from the “Liquibase bridge” between Hibernate and MySQL: Hibernate knows someway that “native” PK for MySQL requires “auto-increment” but when Liquibase ask for scheme data, Hibernate can’t guess it is for MySLQ and thus keep silent about this critical point…

either, thanks for the workarround, even if “manual” :wink: I like automated stuff!

Thanks.