File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -433,7 +433,8 @@ func (s *DB) FirstOrCreate(out interface{}, where ...interface{}) *DB {
433
433
return c
434
434
}
435
435
436
- // Update update attributes with callbacks, refer: https://jinzhu.github.io/gorm/crud.html#update
436
+ // Update update attributes with callbacks. refer: https://jinzhu.github.io/gorm/crud.html#update
437
+ // WARNING when update with struct, GORM will not update fields that with zero value
437
438
func (s * DB ) Update (attrs ... interface {}) * DB {
438
439
return s .Updates (toSearchableMap (attrs ... ), true )
439
440
}
@@ -480,6 +481,7 @@ func (s *DB) Create(value interface{}) *DB {
480
481
}
481
482
482
483
// Delete delete value match given conditions, if the value has primary key, then will including the primary key as condition
484
+ // WARNING If model has DeletedAt field, GORM will only set field DeletedAt's value to current time
483
485
func (s * DB ) Delete (value interface {}, where ... interface {}) * DB {
484
486
return s .NewScope (value ).inlineCondition (where ... ).callCallbacks (s .parent .callbacks .deletes ).db
485
487
}
You can’t perform that action at this time.
0 commit comments