Schema migrator should use case insensitive column comparison of foreign keys
Description
Attachments
1
Activity
Show:
Emmanuel Duchastenier April 30, 2021 at 2:55 PM
Anyone to review my pull-request?
Emmanuel Duchastenier March 23, 2021 at 5:04 PM
Hi, I contribute the fix to this issue on the 5.4 line
Fixed
Details
Details
Assignee
Emmanuel Duchastenier
Emmanuel DuchastenierReporter
Olaf Ziems
Olaf ZiemsComponents
Fix versions
Affects versions
Priority
Created December 12, 2019 at 3:43 PM
Updated May 12, 2021 at 3:50 PM
Resolved April 30, 2021 at 5:50 PM
Some databases use upper-case column names. Thus, the schema migrator should use case-insensitive comparison, in case entity column definitions use lower-case column names.
Since this is currently not done, the migrator might try to re-create a foreign key and fail, if comparing the name of the foreign key also fails. This results in many exceptions that pollute the log and make it very hard to read.
org.hibernate.tool.schema.internal.AbstractSchemaMigrator.checkForExistingForeignKey:
To fix this,
existingReferencingColumn
could be obtained just likeexistingReferencedTable
:See test case in