Remove room index option for winners#17
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a2c4cdb7b
ℹ️ 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".
| @@ -0,0 +1,3 @@ | |||
| DROP INDEX `event_winner_event_id_room_index_user_id_unique`;--> statement-breakpoint | |||
| CREATE UNIQUE INDEX `event_winner_event_id_user_id_unique` ON `event_winner` (`event_id`,`user_id`);--> statement-breakpoint | |||
There was a problem hiding this comment.
Deduplicate winners before adding unique index
This migration fails on any existing database where the same user was declared a winner for multiple rooms in the same event, which the previous (event_id, room_index, user_id) unique constraint explicitly allowed. When such rows exist, CREATE UNIQUE INDEX ... (event_id, user_id) raises a uniqueness error before room_index is dropped, so the bot cannot migrate/start for those guilds; add a data-migration step to collapse or delete duplicates before creating the new unique index.
Useful? React with 👍 / 👎.
No description provided.