Skip to content

fix: count challenge wins from challenges.winner_id instead of badges - #2

Closed
eddmann wants to merge 1 commit into
mainfrom
claude/document-profile-stats-HBYlG
Closed

eddmann wants to merge 1 commit into
mainfrom
claude/document-profile-stats-HBYlG

Conversation

@eddmann

@eddmann eddmann commented Mar 14, 2026

Copy link
Copy Markdown
Owner

The unique index on user_badges(user_id, badge_type) prevented users
from having more than one challenge_winner badge, so the wins count
was always capped at 1. Instead, add a winner_id column to challenges
and count completed challenges where the user is the winner.

https://claude.ai/code/session_01U4YhX59N5LTdt3qpcrXCQR

The unique index on user_badges(user_id, badge_type) prevented users
from having more than one challenge_winner badge, so the wins count
was always capped at 1. Instead, add a winner_id column to challenges
and count completed challenges where the user is the winner.

https://claude.ai/code/session_01U4YhX59N5LTdt3qpcrXCQR
@eddmann eddmann closed this Mar 15, 2026
@eddmann
eddmann deleted the claude/document-profile-stats-HBYlG branch March 15, 2026 01:28
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.

2 participants