SQL Server database, default mapping of time type to DATETIME2

This commit is contained in:
CyJaySong 2023-07-27 17:22:07 +08:00
parent 3396c4cbba
commit 6c8799fdea
2 changed files with 1 additions and 6 deletions

View File

@ -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] == '.' {

View File

@ -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