diff --git a/examples/goroutine.db-journal b/examples/goroutine.db-journal deleted file mode 100644 index 95fc238e..00000000 Binary files a/examples/goroutine.db-journal and /dev/null differ diff --git a/mssql_dialect.go b/mssql_dialect.go index 57985ad9..0eef76d4 100644 --- a/mssql_dialect.go +++ b/mssql_dialect.go @@ -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 diff --git a/sqlite3_dialect.go b/sqlite3_dialect.go index c525e5be..94e7d6b3 100644 --- a/sqlite3_dialect.go +++ b/sqlite3_dialect.go @@ -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