SchemaMigrator wants to alter my columns

Hi Folks,

I’m converting our JPA project to Hibernate, and I’m using the SchemaMigrator tool to create a database update script based on our current entities. It works well, but version 6.2.3 gives me different output than version 5.6.15, suggesting changes in columns that aren’t necessary or desired.

alter table distributor_invoice modify column totalAmount float(53);
alter table distributor_invoice modify column resolvedTime  datetime(6);
alter table distributor_invoice modify column invoiceStatus  enum ('DUPLICATE','FINALIZING','INVALID','ON_HOLD','VALID');

The database is MySQL 5.7.

For the first line, the entity has a ‘double’ field, and the database has a double ‘column’. float(53) may be another way to express double, but I don’t want that to appear in the update script.

For the second line, the entity has a java.util.Date field, and the database has a ‘datetime’ column. I would prefer to keep the type as datetime.

For the third line, the entity has an ‘enum’ field and the database has a ‘varchar(20)’ column. I would prefer to keep that column type.

Is there a way to configure the type-mapping in the SchemaMigrator, or could this be a bug?

I think you might be affected by [HHH-16360] - Hibernate JIRA which is already fixed on main but not yet backported to 6.2. Maybe you can give 6.3.0-SNAPSHOT a try and let us know if that fixes the issue for you?
Using that version requires that you use the http://oss.sonatype.org/content/repositories/snapshots/ maven repository.