From 5510be60a3e71377cd9290c181a675ad658240d0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 29 Jul 2021 00:14:35 +0800 Subject: [PATCH] Fix test --- dialects/postgres.go | 4 ++-- integrations/types_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dialects/postgres.go b/dialects/postgres.go index cf760e18..b0517ac3 100644 --- a/dialects/postgres.go +++ b/dialects/postgres.go @@ -879,13 +879,13 @@ func (db *postgres) SetQuotePolicy(quotePolicy QuotePolicy) { func (db *postgres) SQLType(c *schemas.Column) string { var res string switch t := c.SQLType.Name; t { - case schemas.TinyInt: + case schemas.TinyInt, schemas.UnsignedTinyInt, schemas.UnsignedSmallInt: res = schemas.SmallInt return res case schemas.Bit: res = schemas.Boolean return res - case schemas.MediumInt, schemas.Int, schemas.Integer: + case schemas.MediumInt, schemas.Int, schemas.Integer, schemas.UnsignedMediumInt: if c.IsAutoIncrement { return schemas.Serial } diff --git a/integrations/types_test.go b/integrations/types_test.go index 9f308a5b..4bdbb6fe 100644 --- a/integrations/types_test.go +++ b/integrations/types_test.go @@ -512,7 +512,7 @@ func TestUnsignedTinyInt(t *testing.T) { case schemas.MYSQL: assert.EqualValues(t, "UNSIGNED TINYINT", tables[0].Columns()[0].SQLType.Name) case schemas.POSTGRES: - assert.EqualValues(t, "INT", tables[0].Columns()[0].SQLType.Name) + assert.EqualValues(t, "SMALLINT", tables[0].Columns()[0].SQLType.Name) case schemas.MSSQL: assert.EqualValues(t, "INT", tables[0].Columns()[0].SQLType.Name) default: