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)}