Fix test
This commit is contained in:
parent
52ce535184
commit
5510be60a3
|
@ -879,13 +879,13 @@ func (db *postgres) SetQuotePolicy(quotePolicy QuotePolicy) {
|
||||||
func (db *postgres) SQLType(c *schemas.Column) string {
|
func (db *postgres) SQLType(c *schemas.Column) string {
|
||||||
var res string
|
var res string
|
||||||
switch t := c.SQLType.Name; t {
|
switch t := c.SQLType.Name; t {
|
||||||
case schemas.TinyInt:
|
case schemas.TinyInt, schemas.UnsignedTinyInt, schemas.UnsignedSmallInt:
|
||||||
res = schemas.SmallInt
|
res = schemas.SmallInt
|
||||||
return res
|
return res
|
||||||
case schemas.Bit:
|
case schemas.Bit:
|
||||||
res = schemas.Boolean
|
res = schemas.Boolean
|
||||||
return res
|
return res
|
||||||
case schemas.MediumInt, schemas.Int, schemas.Integer:
|
case schemas.MediumInt, schemas.Int, schemas.Integer, schemas.UnsignedMediumInt:
|
||||||
if c.IsAutoIncrement {
|
if c.IsAutoIncrement {
|
||||||
return schemas.Serial
|
return schemas.Serial
|
||||||
}
|
}
|
||||||
|
|
|
@ -512,7 +512,7 @@ func TestUnsignedTinyInt(t *testing.T) {
|
||||||
case schemas.MYSQL:
|
case schemas.MYSQL:
|
||||||
assert.EqualValues(t, "UNSIGNED TINYINT", tables[0].Columns()[0].SQLType.Name)
|
assert.EqualValues(t, "UNSIGNED TINYINT", tables[0].Columns()[0].SQLType.Name)
|
||||||
case schemas.POSTGRES:
|
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:
|
case schemas.MSSQL:
|
||||||
assert.EqualValues(t, "INT", tables[0].Columns()[0].SQLType.Name)
|
assert.EqualValues(t, "INT", tables[0].Columns()[0].SQLType.Name)
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue