fix bit type on postgres
This commit is contained in:
parent
6a56f45255
commit
d4a068ff06
|
@ -781,6 +781,9 @@ func (db *postgres) SqlType(c *core.Column) string {
|
||||||
case core.TinyInt:
|
case core.TinyInt:
|
||||||
res = core.SmallInt
|
res = core.SmallInt
|
||||||
return res
|
return res
|
||||||
|
case core.Bit:
|
||||||
|
res = core.Boolean
|
||||||
|
return res
|
||||||
case core.MediumInt, core.Int, core.Integer:
|
case core.MediumInt, core.Int, core.Integer:
|
||||||
if c.IsAutoIncrement {
|
if c.IsAutoIncrement {
|
||||||
return core.Serial
|
return core.Serial
|
||||||
|
|
|
@ -65,7 +65,7 @@ func TestQueryString2(t *testing.T) {
|
||||||
assert.Equal(t, 1, len(records))
|
assert.Equal(t, 1, len(records))
|
||||||
assert.Equal(t, 2, len(records[0]))
|
assert.Equal(t, 2, len(records[0]))
|
||||||
assert.Equal(t, "1", records[0]["id"])
|
assert.Equal(t, "1", records[0]["id"])
|
||||||
assert.Equal(t, "0", records[0]["msg"])
|
assert.True(t, "0" == records[0]["msg"] || "false" == records[0]["msg"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func toString(i interface{}) string {
|
func toString(i interface{}) string {
|
||||||
|
|
Loading…
Reference in New Issue