Skip to content

Commit 3f4ad4a

Browse files
committed
HHH-18784 TableMigrator shouldn't alter column length if actual is greater than required
1 parent d6e85b0 commit 3f4ad4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hibernate-core/src/main/java/org/hibernate/tool/schema/internal/ColumnDefinitions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static boolean hasMatchingLength(Column column, ColumnInformation columnInformat
6363
final Size size = column.getColumnSize( dialect, metadata );
6464
final Long requiredLength = size.getLength();
6565
return requiredLength == null
66-
|| requiredLength == actualLength;
66+
|| requiredLength <= actualLength;
6767
}
6868
else if ( isNumericOrDecimal( sqlType ) ) {
6969
// Postgres, H2, SQL Server, and MySQL agree on the following:
@@ -74,7 +74,7 @@ else if ( isNumericOrDecimal( sqlType ) ) {
7474
final Integer requiredScale = size.getScale();
7575
return requiredPrecision == null
7676
|| requiredScale == null
77-
|| requiredScale == actualScale && requiredPrecision == actualPrecision;
77+
|| requiredScale <= actualScale && requiredPrecision <= actualPrecision;
7878
}
7979
// I would really love this to be able to change the binary
8080
// precision of a float/double type, but there simply doesn't

0 commit comments

Comments
 (0)