database/gdb/gdb_model_soft_time: fix soft-time support fieldType:LocalTypeUint64 in Insert/Update perations (#3551)

This commit is contained in:
Muddy 2024-04-29 19:00:51 +08:00 committed by GitHub
parent 5b7cae78bc
commit 9aa426a105
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -333,7 +333,7 @@ func (m *softTimeMaintainer) getConditionByFieldNameAndTypeForSoftDeleting(
switch fieldType {
case LocalTypeDate, LocalTypeDatetime:
return fmt.Sprintf(`%s IS NULL`, quotedFieldName)
case LocalTypeInt, LocalTypeUint, LocalTypeInt64, LocalTypeBool:
case LocalTypeInt, LocalTypeUint, LocalTypeInt64, LocalTypeUint64, LocalTypeBool:
return fmt.Sprintf(`%s=0`, quotedFieldName)
default:
intlog.Errorf(
@ -372,7 +372,7 @@ func (m *softTimeMaintainer) GetValueByFieldTypeForCreateOrUpdate(
switch fieldType {
case LocalTypeDate, LocalTypeDatetime:
value = gtime.Now()
case LocalTypeInt, LocalTypeUint, LocalTypeInt64:
case LocalTypeInt, LocalTypeUint, LocalTypeInt64, LocalTypeUint64:
value = gtime.Timestamp()
case LocalTypeBool:
value = 1