Database Schema
The system is built around several core entities that model a tournament structure:Entity Relationship Diagram
Database Models
MatchRoom
Represents a scheduled match between two teams in the Elimination Stage
QualifierRoom
Represents a lobby for the Qualifier Stage where multiple players compete
Round
Defines a tournament stage with its rules, map pool, and format
User & Player
User registration linking osu! identity to Discord, and player-specific data
RefereeInfo
Authentication and identity information for tournament referees
ScoreResults
Individual score entries parsed from match results
Entity Relationships Summary
Match Management
- MatchRoom represents elimination stage matches between two teams
- QualifierRoom represents qualifier stage lobbies for multiple players
- Both reference a Round for rules and map pool
- Both can be assigned a RefereeInfo for management
User System
- User is the core identity linking Discord and osu! accounts
- OsuUser stores cached osu! profile data (rank, username)
- Player extends User with tournament-specific data (availability, qualifier assignment)
Score Tracking
- ScoreResults stores individual player performance per map
- Links to both User (player) and Round (tournament stage)
Common Patterns
Foreign Keys
All relationships use Entity Framework navigation properties:JSON Storage
Complex data structures are stored as JSON in database columns:MatchRoom.BannedMapsandPickedMapsstore pick/ban sequencesRound.MapPoolstores the beatmap poolPlayer.Availabilitystores time slot preferences
Match References
Both match types store a reference to the Bancho match:MpLinkId: The numerical ID fromhttps://osu.ppy.sh/community/matches/{MpLinkId}
Database Tables
| Model | Table Name | Primary Key | Description |
|---|---|---|---|
| MatchRoom | match_rooms | id (string) | Elimination stage matches (e.g., “A1”, “C2”) |
| QualifierRoom | qualifier_rooms | id (string) | Qualifier stage lobbies |
| Round | rounds | id (int) | Tournament stages and rules |
| User | users | id (int) | Registered users |
| OsuUser | osu_user | id (int) | osu! profile cache |
| Player | players | id (int) | Tournament participants |
| RefereeInfo | referees | id (int) | Referee accounts |
| ScoreResults | N/A | id (int) | Match scores |