Skip to content

Commit

Permalink
fix(dao/runner): remove duplicate key column hostname in OnConflict c…
Browse files Browse the repository at this point in the history
…lause
  • Loading branch information
joschahenningsen committed Feb 4, 2025
1 parent efc80f2 commit edd1a89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dao/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func (d runnerDao) Get(c context.Context, id uint) (res model.Runner, err error)
// Create a Runner.
func (d runnerDao) Create(c context.Context, it *model.Runner) error {
return d.db.WithContext(c).Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "hostname"}, {Name: "hostname"}}, // key column
DoUpdates: clause.AssignmentColumns([]string{"port"}), // column needed to be updated
Columns: []clause.Column{{Name: "hostname"}}, // key column
DoUpdates: clause.AssignmentColumns([]string{"port"}), // column needed to be updated
}).Create(it).Error
}

Expand Down

0 comments on commit edd1a89

Please sign in to comment.