Skip to content

Commit

Permalink
feat: refactor Save
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1v3r committed Sep 27, 2021
1 parent 2ce6763 commit 03725ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion do.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ func (d *DO) CreateInBatches(value interface{}, batchSize int) error {
}

func (d *DO) Save(value interface{}) error {
return d.db.Save(value).Error
return d.db.Clauses(clause.OnConflict{UpdateAll: true}).Create(value).Error
}

func (d *DO) First() (result interface{}, err error) {
Expand Down

0 comments on commit 03725ec

Please sign in to comment.