Skip to content

fix migration edge case#18

Merged
getBoolean merged 1 commit into
prodfrom
master
May 31, 2026
Merged

fix migration edge case#18
getBoolean merged 1 commit into
prodfrom
master

Conversation

@getBoolean
Copy link
Copy Markdown
Owner

No description provided.

@getBoolean getBoolean enabled auto-merge May 31, 2026 08:18
@getBoolean getBoolean merged commit 14cd100 into prod May 31, 2026
5 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2bdd2e99ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -1,3 +1,4 @@
DROP INDEX `event_winner_event_id_room_index_user_id_unique`;--> statement-breakpoint
DELETE FROM `event_winner` WHERE `id` NOT IN (SELECT MIN(`id`) FROM `event_winner` GROUP BY `event_id`, `user_id`);--> statement-breakpoint
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve distinct winner roles when deduping rows

When an existing event has the same user declared in multiple rooms under different role_id values (possible if the event's winner role was changed between room declarations), this deletes all but the lowest-id row for that user. clearEventWinners later revokes only the roleId values still present in event_winner (see src/utils/winner.utils.ts lines 64-70), so the discarded role grants have no remaining cleanup record and can be left on the member after the next clear/open cycle. Consider detecting conflicting role_ids before deduping or otherwise preserving/removing those extra role grants instead of silently dropping the rows.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant