Skip to content

Commit

Permalink
Also update unix_updated_at when reordering to avoid PK conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Apr 3, 2024
1 parent 0a46076 commit f65dec3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async Task<int> OnExecuteAsync(CancellationToken cancellationToken)

if (!DryRun)
{
await conn.ExecuteAsync("UPDATE scores SET id = @newScoreId WHERE legacy_score_id = @legacyScoreId AND ruleset_id = @rulesetId", new
await conn.ExecuteAsync("UPDATE scores SET id = @newScoreId, unix_updated_at = UNIX_TIMESTAMP(NOW()) WHERE legacy_score_id = @legacyScoreId AND ruleset_id = @rulesetId", new
{
newScoreId = newScoreId,
legacyScoreId = legacyScoreId,
Expand Down

0 comments on commit f65dec3

Please sign in to comment.