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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
dt.IsZero()
|
|
||||||
dt = dt.In(convertedLocation)
|
dt = dt.In(convertedLocation)
|
||||||
return &dt, nil
|
return &dt, nil
|
||||||
} else if len(s) >= 21 && s[10] == 'T' && s[19] == '.' {
|
} else if len(s) >= 21 && s[10] == 'T' && s[19] == '.' {
|
||||||
|
|
|
@ -320,11 +320,7 @@ func (db *mssql) SQLType(c *schemas.Column) string {
|
||||||
res += "(MAX)"
|
res += "(MAX)"
|
||||||
}
|
}
|
||||||
case schemas.TimeStamp, schemas.DateTime:
|
case schemas.TimeStamp, schemas.DateTime:
|
||||||
if c.Length > 3 {
|
return "DATETIME2"
|
||||||
res = "DATETIME2"
|
|
||||||
} else {
|
|
||||||
return schemas.DateTime
|
|
||||||
}
|
|
||||||
case schemas.TimeStampz:
|
case schemas.TimeStampz:
|
||||||
res = "DATETIMEOFFSET"
|
res = "DATETIMEOFFSET"
|
||||||
c.Length = 7
|
c.Length = 7
|
||||||
|
|
Loading…
Reference in New Issue