add tag "ALWAYSUPDATE" to update zero value
This commit is contained in:
parent
d96acc5df6
commit
04f8798a85
@ -239,6 +239,9 @@ func ConvertToAssignments(stmt *gorm.Statement) (set clause.Set) {
|
|||||||
value = stmt.DB.NowFunc().Unix()
|
value = stmt.DB.NowFunc().Unix()
|
||||||
}
|
}
|
||||||
isZero = false
|
isZero = false
|
||||||
|
} else if isZero {
|
||||||
|
_, isZero = field.TagSettings["ALWAYSUPDATE"]
|
||||||
|
isZero = !isZero
|
||||||
}
|
}
|
||||||
|
|
||||||
if ok || !isZero {
|
if ok || !isZero {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user