fix: use bigint for uint32 and uint16 in postgres driver (#4301)

This commit is contained in:
Tobias Krischer
2025-01-16 20:26:06 +01:00
committed by GitHub
parent b91f8daf0e
commit f9572c6f18

View File

@@ -112,11 +112,11 @@ func (d *Postgres) atTypeC(c1 *Column, c2 *schema.Column) error {
switch c1.Type {
case field.TypeBool:
t = &schema.BoolType{T: postgres.TypeBoolean}
case field.TypeUint8, field.TypeInt8, field.TypeInt16, field.TypeUint16:
case field.TypeUint8, field.TypeInt8, field.TypeInt16:
t = &schema.IntegerType{T: postgres.TypeSmallInt}
case field.TypeInt32, field.TypeUint32:
case field.TypeUint16, field.TypeInt32:
t = &schema.IntegerType{T: postgres.TypeInt}
case field.TypeInt, field.TypeUint, field.TypeInt64, field.TypeUint64:
case field.TypeUint32, field.TypeInt, field.TypeUint, field.TypeInt64, field.TypeUint64:
t = &schema.IntegerType{T: postgres.TypeBigInt}
case field.TypeFloat32:
t = &schema.FloatType{T: c1.scanTypeOr(postgres.TypeReal)}