Skip to content

Commit

Permalink
Fix query order
Browse files Browse the repository at this point in the history
  • Loading branch information
Swan committed Nov 24, 2024
1 parent 8b2a5e4 commit bb4af23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/console/commands/remove_mod_clan_scores.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var RemoveUnrankedClanScores = &cobra.Command{
scores := make([]*db.Score, 0)

result := db.SQL.
Where("clan_id IS NOT NULL and mods > 0").
Where("clan_id IS NOT NULL AND mods > 0").
Find(&scores)

if result.Error != nil {
Expand All @@ -28,8 +28,8 @@ var RemoveUnrankedClanScores = &cobra.Command{
}

err := db.SQL.Model(&db.Score{}).
Update("clan_id", nil).
Where("id = ?", score.Id).Error
Where("id = ?", score.Id).
Update("clan_id", nil).Error

if err != nil {
logrus.Error(err)
Expand Down

0 comments on commit bb4af23

Please sign in to comment.