From f9572c6f187d1e19ccfd898039705358cb4a39f8 Mon Sep 17 00:00:00 2001 From: Tobias Krischer Date: Thu, 16 Jan 2025 20:26:06 +0100 Subject: [PATCH] fix: use bigint for uint32 and uint16 in postgres driver (#4301) --- dialect/sql/schema/postgres.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dialect/sql/schema/postgres.go b/dialect/sql/schema/postgres.go index 133801087..e28ce722d 100644 --- a/dialect/sql/schema/postgres.go +++ b/dialect/sql/schema/postgres.go @@ -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)}