This commit is contained in:
Lunny Xiao 2015-07-08 16:53:35 +08:00
parent 2ee7de9fa5
commit ffa0712280
3 changed files with 13 additions and 1 deletions

Binary file not shown.

View File

@ -220,6 +220,11 @@ func (db *mssql) SqlType(c *core.Column) string {
switch t := c.SQLType.Name; t {
case core.Bool:
res = core.TinyInt
if c.Default == "true" {
c.Default = "1"
} else if c.Default == "false" {
c.Default = "0"
}
case core.Serial:
c.IsAutoIncrement = true
c.IsPrimaryKey = true

View File

@ -156,6 +156,13 @@ func (db *sqlite3) Init(d *core.DB, uri *core.Uri, drivername, dataSourceName st
func (db *sqlite3) SqlType(c *core.Column) string {
switch t := c.SQLType.Name; t {
case core.Bool:
if c.Default == "true" {
c.Default = "1"
} else if c.Default == "false" {
c.Default = "0"
}
return core.Integer
case core.Date, core.DateTime, core.TimeStamp, core.Time:
return core.DateTime
case core.TimeStampz:
@ -163,7 +170,7 @@ func (db *sqlite3) SqlType(c *core.Column) string {
case core.Char, core.Varchar, core.NVarchar, core.TinyText,
core.Text, core.MediumText, core.LongText, core.Json:
return core.Text
case core.Bit, core.TinyInt, core.SmallInt, core.MediumInt, core.Int, core.Integer, core.BigInt, core.Bool:
case core.Bit, core.TinyInt, core.SmallInt, core.MediumInt, core.Int, core.Integer, core.BigInt:
return core.Integer
case core.Float, core.Double, core.Real:
return core.Real