Skip to content

Commit

Permalink
Merge pull request #53 from ArtisanCloud/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Matrix-X authored Nov 15, 2022
2 parents 297431b + 2cca2a9 commit 3e0265f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion database/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,12 @@ func UpsertModelsOnUniqueID(db *gorm.DB, mdl interface{}, uniqueName string,

result := db.Model(mdl).
//Debug().
Omit(clause.Associations).
Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: uniqueName}},
DoUpdates: clause.AssignmentColumns(fieldsToUpdate),
}).Create(models)
}).
Create(models)

return result.Error
}
Expand Down

0 comments on commit 3e0265f

Please sign in to comment.