SQL Server database, default mapping of time type to DATETIME2
This commit is contained in:
parent
3396c4cbba
commit
6c8799fdea
|
@ -45,7 +45,6 @@ func String2Time(s string, originalLocation *time.Location, convertedLocation *t
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dt.IsZero()
|
||||
dt = dt.In(convertedLocation)
|
||||
return &dt, nil
|
||||
} else if len(s) >= 21 && s[10] == 'T' && s[19] == '.' {
|
||||
|
|
|
@ -320,11 +320,7 @@ func (db *mssql) SQLType(c *schemas.Column) string {
|
|||
res += "(MAX)"
|
||||
}
|
||||
case schemas.TimeStamp, schemas.DateTime:
|
||||
if c.Length > 3 {
|
||||
res = "DATETIME2"
|
||||
} else {
|
||||
return schemas.DateTime
|
||||
}
|
||||
return "DATETIME2"
|
||||
case schemas.TimeStampz:
|
||||
res = "DATETIMEOFFSET"
|
||||
c.Length = 7
|
||||
|
|
Loading…
Reference in New Issue