The changes introduced in https://hibernate.atlassian.net/browse/HHH-15870 cause false positives in several cases in our project.
- TIMESTAMP: in org.hibernate.tool.schema.internal.ColumnDefinitions.hasMatchingLength(Column, ColumnInformation, Metadata, Dialect) the length of the field is compared against the required precision.
- floating point values: the required precision is much higher (e.g. 57) than the precision reported by the database
- text: text (with length int_max) should be acceptable as column type for a string with required length 255
- int vs smallint: when storing enums an integer column should be acceptable but is rejected due to smallint and int not matching according to ColumnDefinitions.hasMatchingType
An additional problem: When specifying a type via @Column(columnDefinition = "..."), the DDL validator will still use the inferred value for figuring out the constraints. When using DDL update this will cause schema updates with the already existing db type, e.g. ALTER TABLE IF EXISTS test ALTER COLUMN state SET DATA TYPE INTEGER; even though test.state is already INTEGER. Workaround to make the system usable for now, because there is no way to disable the new functionality:
Maybe related to https://hibernate.atlassian.net/browse/HHH-16498 |