Fix timesatmp #2021

Merged
lunny merged 7 commits from lunny/timestamp into master 2021-08-04 08:12:10 +00:00
Showing only changes of commit ef81f61ada - Show all commits

View File

@ -313,8 +313,12 @@ func (db *mssql) SQLType(c *schemas.Column) string {
if c.Length == 0 {
res += "(MAX)"
}
case schemas.TimeStamp:
res = schemas.DateTime
case schemas.TimeStamp, schemas.DateTime:
if c.Length > 3 {
res = "DATETIME2"
} else {
res = schemas.DateTime
}
case schemas.TimeStampz:
res = "DATETIMEOFFSET"
c.Length = 7
@ -357,7 +361,7 @@ func (db *mssql) SQLType(c *schemas.Column) string {
res = t
}
if res == schemas.Int || res == schemas.Bit || res == schemas.DateTime {
if res == schemas.Int || res == schemas.Bit {
return res
}