Open frangere opened 9 months ago
In Postgres, there's a similar problem when we use an "Instant" column with Hibernate. Hibernate creates a type like timestamp(6) with time zone
. But the toDataType
function doesn't handle this properly and removes the time zone info, so it ends up as just timestamp(6)
.
Any updates on this? This bug requires us to write all changelogs regarding enums manually.
Env:
Gradle:
Entity class:
Try to use:
gradle diffChangelog
to generate sql file, got:which result in wrong SQL.
expected:
Root cause: According https://docs.jboss.org/hibernate/orm/6.2/migration-guide/migration-guide.html#ddl-implicit-datatype-enum, Hibernate 6 uses
enum
types on MySQL by default, but Liquibase hibernate6 classColumnSnapshotGenerator#toDataType
cannot processhibernateType
withENUM('ACTIVE', 'INACTIVE')
, this method just keepENUM
as sql type.Workaround: Right now, we are add:
to make sure still using old stype
VARCHAR
for ENUM.