Now, I use a big int column as delete timestamp of table which is stored with an UNIX timestamp,
but XORM build out an invalid SQL with delete_timestamp = '01-00-01 xxxx', NOT delete_timestamp=0.
So I try to modified code below to fix this issue.
// CondDeleted returns the conditions whether a record is soft deleted.
func (engine *Engine) CondDeleted(sqlTypeName, colName string) builder.Cond {
if engine.dialect.DBType() == core.MSSQL {
return builder.IsNull{colName}
}
switch sqlTypeName {
case core.BigInt, core.Int:
return builder.IsNull{colName}.Or(builder.Eq{colName: 0})
default:
return builder.IsNull{colName}.Or(builder.Eq{colName: zeroTime1})
}
}
Now, I use a big int column as delete timestamp of table which is stored with an UNIX timestamp, but XORM build out an invalid SQL with delete_timestamp = '01-00-01 xxxx', NOT delete_timestamp=0.
So I try to modified code below to fix this issue.