Fix code
This commit is contained in:
parent
85502d4779
commit
d3926afde6
|
@ -18,9 +18,12 @@ func FormatColumnTime(dialect Dialect, dbLocation *time.Location, col *schemas.C
|
|||
if col.Nullable {
|
||||
return nil, nil
|
||||
}
|
||||
if col.SQLType.IsNumeric() || col.SQLType.Name == schemas.TimeStamp || col.SQLType.Name == schemas.TimeStampz {
|
||||
if col.SQLType.IsNumeric() {
|
||||
return 0, nil
|
||||
}
|
||||
if col.SQLType.Name == schemas.TimeStamp || col.SQLType.Name == schemas.TimeStampz {
|
||||
t = time.Unix(0, 0)
|
||||
}
|
||||
}
|
||||
|
||||
tmZone := dbLocation
|
||||
|
|
|
@ -704,8 +704,10 @@ func (statement *Statement) CondDeleted(col *schemas.Column) builder.Cond {
|
|||
colName = statement.quote(prefix) + "." + statement.quote(col.Name)
|
||||
}
|
||||
cond := builder.NewCond()
|
||||
if col.SQLType.IsNumeric() || col.SQLType.Name == schemas.TimeStamp || col.SQLType.Name == schemas.TimeStampz {
|
||||
if col.SQLType.IsNumeric() {
|
||||
cond = builder.Eq{colName: 0}
|
||||
} else if col.SQLType.Name == schemas.TimeStamp || col.SQLType.Name == schemas.TimeStampz {
|
||||
cond = builder.Eq{colName: time.Unix(0, 0).In(statement.defaultTimeZone).Format("2006-01-02 15:04:05.999999999")}
|
||||
} else {
|
||||
cond = builder.Eq{colName: utils.ZeroTime1}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue