Fix dump of sqlite #1639

Merged
lunny merged 4 commits from lunny/fix_dump_sqlite into master 2020-07-09 01:41:17 +00:00
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 61de120657 - Show all commits

View File

@ -231,6 +231,7 @@ func (db *mssql) SQLType(c *schemas.Column) string {
} else if strings.EqualFold(c.Default, "false") {
c.Default = "0"
}
return res
case schemas.Serial:
c.IsAutoIncrement = true
c.IsPrimaryKey = true
@ -270,8 +271,8 @@ func (db *mssql) SQLType(c *schemas.Column) string {
res = t
}
if res == schemas.Int {
return schemas.Int
if res == schemas.Int || res == schemas.Bit || res == schemas.DateTime {
return res
}
hasLen1 := (c.Length > 0)

View File

@ -417,7 +417,8 @@ func formatColumnValue(dstDialect dialects.Dialect, d interface{}, col *schemas.
return "NULL"
}
if dq, ok := d.(bool); ok && dstDialect.URI().DBType == schemas.SQLITE {
if dq, ok := d.(bool); ok && (dstDialect.URI().DBType == schemas.SQLITE ||
dstDialect.URI().DBType == schemas.MSSQL) {
if dq {
return "1"
}