Skip to content

Commit

Permalink
refact(database): add omit Associations for UpsertModelsOnUniqueID
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrix-X committed Nov 15, 2022
1 parent 5912dcf commit 595fd8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions database/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,13 @@ func UpsertModelsOnUniqueID(db *gorm.DB, mdl interface{}, uniqueName string,
}

result := db.Model(mdl).
//Debug().
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 595fd8f

Please sign in to comment.