← Back to About

Data Model

Supabase schema and curated views that power the analytics UI.

Core Tables

tournaments: TopDeck.gg events (location, dates, player_count, rounds, top_cut).

players: TopDeck.gg player identities (name, topdeck_id).

commanders: Commander or partner combinations (name, color_identity, scryfall_ids).

tournament_entries: One player’s entry in one tournament (results, standings, decklist).

games: Individual pod games within a tournament round.

game_participants: One player’s seat and result in a game.

commander_matchups: Commander-vs-commander outcomes per game.

Curated Views

commander_stats: Aggregate entries, win rate, and top cut conversion.

commander_weekly_trends / commander_monthly_trends / commander_wow_mom: Trend rollups.

card_frequencies_by_commander / card_frequencies_global: Inclusion rates.

card_performance_by_commander / card_performance_global: Card performance.

player_tournament_journey / pod_composition / player_seat_distribution: Round-level journeys.

global_elo_* views: Global Elo ratings and leaderboards.

player_commander_entries: Fast per-player commander history for meta prep.

Conventions

Most analytics filter to tournaments with player_count >= 32.

Partner commanders are stored as one combined identity.

Unknown Commander rows are excluded from most analytics and prep outputs.

Source of Truth

Primary schema definitions live in Supabase migrations under packages/backend/supabase/migrations.

Summarized dictionary lives in packages/backend/docs/data_dictionary.md.

Reference

Detailed ERD and field descriptions live at packages/backend/docs/data_dictionary.md.

Local documentation mirror: docs/methodology/data-model.md.