add IsZero check for custom struct column in the Update method
This commit is contained in:
parent
0c9a2f6a70
commit
81bf7ac1eb
|
@ -126,6 +126,9 @@ func (statement *Statement) BuildUpdates(tableValue reflect.Value,
|
|||
|
||||
if fieldValue.CanAddr() {
|
||||
if structConvert, ok := fieldValue.Addr().Interface().(convert.Conversion); ok {
|
||||
if utils.IsZero(fieldValue.Interface()) {
|
||||
continue
|
||||
}
|
||||
data, err := structConvert.ToDB()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
|
Loading…
Reference in New Issue