brackt/drizzle/meta/0024_snapshot.json

2786 lines
72 KiB
JSON
Raw Normal View History

feat: implement Expected Value System with ICM probability calculator Implements Phase 5.2 of the EV system with Harville-Malmuth Independent Chip Model for calculating participant placement probabilities from futures odds. ## Key Features ### ICM Probability Calculator - Implements Harville-Malmuth method for distributing probabilities - Converts American odds to championship probabilities - Generates P(1st) through P(8th) for all participants - Column-normalized: each placement sums to 100% across all teams - Works with any number of participants (not limited to 8) ### Admin UI - Futures Odds Entry - Enter American odds (e.g., +550, -200) for championship futures - Live preview of ICM-calculated probability distributions - Displays all 8 placement probabilities - Persists odds for editing on subsequent visits - Automatic probability normalization (removes bookmaker vig) ### Database Schema Updates - Renamed participant_expected_values.season_id → sports_season_id - Updated foreign key to reference sports_seasons instead of seasons - Added source_odds field to store original futures odds - Migration 0025: Column rename and FK update - Migration 0026: Add source_odds field ### Model Layer - participant-expected-value: CRUD operations for probability distributions - Supports multiple probability sources (manual, futures_odds, elo_simulation) - Automatic EV calculation based on league scoring rules - Probability validation and normalization ### Service Layer - icm-calculator: Harville-Malmuth probability distribution - probability-engine: Odds conversion and Elo utilities (for future use) - bracket-simulator: Monte Carlo simulation (for future hybrid approach) - ev-calculator: Expected value computation from probabilities ## Technical Details - Uses exponential decay favoring top positions for strong teams - Preserves championship probability ordering in final distributions - Row sums vary (strong teams ~100%, weak teams lower) - All probabilities between 0-1, mathematically valid - Comprehensive test suite: 97 tests passing ## Future Enhancements - Hybrid approach: ICM pre-playoffs, bracket simulation during playoffs - Integration with league-specific scoring rules - Historical probability tracking for accuracy analysis 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 22:19:46 -08:00
{
"id": "5c8a10ba-c477-491d-9f2f-20bd95f5496b",
"prevId": "6fb2f02b-46e6-4683-a311-1907169289c1",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.autodraft_settings": {
"name": "autodraft_settings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"team_id": {
"name": "team_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"is_enabled": {
"name": "is_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"mode": {
"name": "mode",
"type": "autodraft_mode",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'next_pick'"
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"autodraft_settings_season_id_seasons_id_fk": {
"name": "autodraft_settings_season_id_seasons_id_fk",
"tableFrom": "autodraft_settings",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"autodraft_settings_team_id_teams_id_fk": {
"name": "autodraft_settings_team_id_teams_id_fk",
"tableFrom": "autodraft_settings",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.commissioners": {
"name": "commissioners",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"league_id": {
"name": "league_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"commissioners_league_id_leagues_id_fk": {
"name": "commissioners_league_id_leagues_id_fk",
"tableFrom": "commissioners",
"tableTo": "leagues",
"columnsFrom": [
"league_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.draft_picks": {
"name": "draft_picks",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"team_id": {
"name": "team_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"participant_id": {
"name": "participant_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"pick_number": {
"name": "pick_number",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"round": {
"name": "round",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"pick_in_round": {
"name": "pick_in_round",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"picked_by_user_id": {
"name": "picked_by_user_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"picked_by_type": {
"name": "picked_by_type",
"type": "picked_by_type",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"time_used": {
"name": "time_used",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"draft_picks_season_id_seasons_id_fk": {
"name": "draft_picks_season_id_seasons_id_fk",
"tableFrom": "draft_picks",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"draft_picks_team_id_teams_id_fk": {
"name": "draft_picks_team_id_teams_id_fk",
"tableFrom": "draft_picks",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"draft_picks_participant_id_participants_id_fk": {
"name": "draft_picks_participant_id_participants_id_fk",
"tableFrom": "draft_picks",
"tableTo": "participants",
"columnsFrom": [
"participant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.draft_queue": {
"name": "draft_queue",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"team_id": {
"name": "team_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"participant_id": {
"name": "participant_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"queue_position": {
"name": "queue_position",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"draft_queue_season_id_seasons_id_fk": {
"name": "draft_queue_season_id_seasons_id_fk",
"tableFrom": "draft_queue",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"draft_queue_team_id_teams_id_fk": {
"name": "draft_queue_team_id_teams_id_fk",
"tableFrom": "draft_queue",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"draft_queue_participant_id_participants_id_fk": {
"name": "draft_queue_participant_id_participants_id_fk",
"tableFrom": "draft_queue",
"tableTo": "participants",
"columnsFrom": [
"participant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.draft_slots": {
"name": "draft_slots",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"team_id": {
"name": "team_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"draft_order": {
"name": "draft_order",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"draft_slots_season_id_seasons_id_fk": {
"name": "draft_slots_season_id_seasons_id_fk",
"tableFrom": "draft_slots",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"draft_slots_team_id_teams_id_fk": {
"name": "draft_slots_team_id_teams_id_fk",
"tableFrom": "draft_slots",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.draft_timers": {
"name": "draft_timers",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"team_id": {
"name": "team_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"time_remaining": {
"name": "time_remaining",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"draft_timers_season_id_seasons_id_fk": {
"name": "draft_timers_season_id_seasons_id_fk",
"tableFrom": "draft_timers",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"draft_timers_team_id_teams_id_fk": {
"name": "draft_timers_team_id_teams_id_fk",
"tableFrom": "draft_timers",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.event_results": {
"name": "event_results",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"scoring_event_id": {
"name": "scoring_event_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"participant_id": {
"name": "participant_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"placement": {
"name": "placement",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"qualifying_points_awarded": {
"name": "qualifying_points_awarded",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": false
},
"eliminated": {
"name": "eliminated",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"raw_score": {
"name": "raw_score",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"event_results_scoring_event_id_scoring_events_id_fk": {
"name": "event_results_scoring_event_id_scoring_events_id_fk",
"tableFrom": "event_results",
"tableTo": "scoring_events",
"columnsFrom": [
"scoring_event_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"event_results_participant_id_participants_id_fk": {
"name": "event_results_participant_id_participants_id_fk",
"tableFrom": "event_results",
"tableTo": "participants",
"columnsFrom": [
"participant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.leagues": {
"name": "leagues",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"created_by": {
"name": "created_by",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"current_season_id": {
"name": "current_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"is_public_draft_board": {
"name": "is_public_draft_board",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.participant_expected_values": {
"name": "participant_expected_values",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"participant_id": {
"name": "participant_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"prob_first": {
"name": "prob_first",
"type": "numeric(5, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"prob_second": {
"name": "prob_second",
"type": "numeric(5, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"prob_third": {
"name": "prob_third",
"type": "numeric(5, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"prob_fourth": {
"name": "prob_fourth",
"type": "numeric(5, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"prob_fifth": {
"name": "prob_fifth",
"type": "numeric(5, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"prob_sixth": {
"name": "prob_sixth",
"type": "numeric(5, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"prob_seventh": {
"name": "prob_seventh",
"type": "numeric(5, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"prob_eighth": {
"name": "prob_eighth",
"type": "numeric(5, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"expected_value": {
"name": "expected_value",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"source": {
"name": "source",
"type": "probability_source",
"typeSchema": "public",
"primaryKey": false,
"notNull": false,
"default": "'manual'"
},
"calculated_at": {
"name": "calculated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"participant_expected_values_participant_id_participants_id_fk": {
"name": "participant_expected_values_participant_id_participants_id_fk",
"tableFrom": "participant_expected_values",
"tableTo": "participants",
"columnsFrom": [
"participant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"participant_expected_values_season_id_seasons_id_fk": {
"name": "participant_expected_values_season_id_seasons_id_fk",
"tableFrom": "participant_expected_values",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.participant_qualifying_totals": {
"name": "participant_qualifying_totals",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"participant_id": {
"name": "participant_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"sports_season_id": {
"name": "sports_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"total_qualifying_points": {
"name": "total_qualifying_points",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"events_scored": {
"name": "events_scored",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"final_ranking": {
"name": "final_ranking",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"participant_qualifying_totals_participant_id_participants_id_fk": {
"name": "participant_qualifying_totals_participant_id_participants_id_fk",
"tableFrom": "participant_qualifying_totals",
"tableTo": "participants",
"columnsFrom": [
"participant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"participant_qualifying_totals_sports_season_id_sports_seasons_id_fk": {
"name": "participant_qualifying_totals_sports_season_id_sports_seasons_id_fk",
"tableFrom": "participant_qualifying_totals",
"tableTo": "sports_seasons",
"columnsFrom": [
"sports_season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.participant_results": {
"name": "participant_results",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"participant_id": {
"name": "participant_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"sports_season_id": {
"name": "sports_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"final_position": {
"name": "final_position",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"qualifying_points": {
"name": "qualifying_points",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": false
},
"notes": {
"name": "notes",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"participant_results_participant_id_participants_id_fk": {
"name": "participant_results_participant_id_participants_id_fk",
"tableFrom": "participant_results",
"tableTo": "participants",
"columnsFrom": [
"participant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"participant_results_sports_season_id_sports_seasons_id_fk": {
"name": "participant_results_sports_season_id_sports_seasons_id_fk",
"tableFrom": "participant_results",
"tableTo": "sports_seasons",
"columnsFrom": [
"sports_season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.participant_season_results": {
"name": "participant_season_results",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"participant_id": {
"name": "participant_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"sports_season_id": {
"name": "sports_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"current_points": {
"name": "current_points",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"current_position": {
"name": "current_position",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"participant_season_results_participant_id_participants_id_fk": {
"name": "participant_season_results_participant_id_participants_id_fk",
"tableFrom": "participant_season_results",
"tableTo": "participants",
"columnsFrom": [
"participant_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"participant_season_results_sports_season_id_sports_seasons_id_fk": {
"name": "participant_season_results_sports_season_id_sports_seasons_id_fk",
"tableFrom": "participant_season_results",
"tableTo": "sports_seasons",
"columnsFrom": [
"sports_season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.participants": {
"name": "participants",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"sports_season_id": {
"name": "sports_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"short_name": {
"name": "short_name",
"type": "varchar(100)",
"primaryKey": false,
"notNull": false
},
"external_id": {
"name": "external_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"expected_value": {
"name": "expected_value",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"participants_sports_season_id_sports_seasons_id_fk": {
"name": "participants_sports_season_id_sports_seasons_id_fk",
"tableFrom": "participants",
"tableTo": "sports_seasons",
"columnsFrom": [
"sports_season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.playoff_matches": {
"name": "playoff_matches",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"scoring_event_id": {
"name": "scoring_event_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"round": {
"name": "round",
"type": "varchar(50)",
"primaryKey": false,
"notNull": true
},
"match_number": {
"name": "match_number",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"participant1_id": {
"name": "participant1_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"participant2_id": {
"name": "participant2_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"winner_id": {
"name": "winner_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"loser_id": {
"name": "loser_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"is_complete": {
"name": "is_complete",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"participant1_score": {
"name": "participant1_score",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": false
},
"participant2_score": {
"name": "participant2_score",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": false
},
"is_scoring": {
"name": "is_scoring",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"template_round": {
"name": "template_round",
"type": "varchar(50)",
"primaryKey": false,
"notNull": false
},
"seed_info": {
"name": "seed_info",
"type": "varchar(50)",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"playoff_matches_scoring_event_id_scoring_events_id_fk": {
"name": "playoff_matches_scoring_event_id_scoring_events_id_fk",
"tableFrom": "playoff_matches",
"tableTo": "scoring_events",
"columnsFrom": [
"scoring_event_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"playoff_matches_participant1_id_participants_id_fk": {
"name": "playoff_matches_participant1_id_participants_id_fk",
"tableFrom": "playoff_matches",
"tableTo": "participants",
"columnsFrom": [
"participant1_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"playoff_matches_participant2_id_participants_id_fk": {
"name": "playoff_matches_participant2_id_participants_id_fk",
"tableFrom": "playoff_matches",
"tableTo": "participants",
"columnsFrom": [
"participant2_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"playoff_matches_winner_id_participants_id_fk": {
"name": "playoff_matches_winner_id_participants_id_fk",
"tableFrom": "playoff_matches",
"tableTo": "participants",
"columnsFrom": [
"winner_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
},
"playoff_matches_loser_id_participants_id_fk": {
"name": "playoff_matches_loser_id_participants_id_fk",
"tableFrom": "playoff_matches",
"tableTo": "participants",
"columnsFrom": [
"loser_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.qualifying_point_config": {
"name": "qualifying_point_config",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"sports_season_id": {
"name": "sports_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"placement": {
"name": "placement",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"points": {
"name": "points",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"qualifying_point_config_sports_season_id_sports_seasons_id_fk": {
"name": "qualifying_point_config_sports_season_id_sports_seasons_id_fk",
"tableFrom": "qualifying_point_config",
"tableTo": "sports_seasons",
"columnsFrom": [
"sports_season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scoring_events": {
"name": "scoring_events",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"sports_season_id": {
"name": "sports_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"event_date": {
"name": "event_date",
"type": "date",
"primaryKey": false,
"notNull": false
},
"event_type": {
"name": "event_type",
"type": "event_type",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"playoff_round": {
"name": "playoff_round",
"type": "varchar(50)",
"primaryKey": false,
"notNull": false
},
"is_qualifying_event": {
"name": "is_qualifying_event",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"bracket_template_id": {
"name": "bracket_template_id",
"type": "varchar(50)",
"primaryKey": false,
"notNull": false
},
"scoring_starts_at_round": {
"name": "scoring_starts_at_round",
"type": "varchar(50)",
"primaryKey": false,
"notNull": false
},
"is_complete": {
"name": "is_complete",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"completed_at": {
"name": "completed_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"scoring_events_sports_season_id_sports_seasons_id_fk": {
"name": "scoring_events_sports_season_id_sports_seasons_id_fk",
"tableFrom": "scoring_events",
"tableTo": "sports_seasons",
"columnsFrom": [
"sports_season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.season_sports": {
"name": "season_sports",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"sports_season_id": {
"name": "sports_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"season_sports_season_id_seasons_id_fk": {
"name": "season_sports_season_id_seasons_id_fk",
"tableFrom": "season_sports",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"season_sports_sports_season_id_sports_seasons_id_fk": {
"name": "season_sports_sports_season_id_sports_seasons_id_fk",
"tableFrom": "season_sports",
"tableTo": "sports_seasons",
"columnsFrom": [
"sports_season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.season_template_sports": {
"name": "season_template_sports",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"template_id": {
"name": "template_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"sports_season_id": {
"name": "sports_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"season_template_sports_template_id_season_templates_id_fk": {
"name": "season_template_sports_template_id_season_templates_id_fk",
"tableFrom": "season_template_sports",
"tableTo": "season_templates",
"columnsFrom": [
"template_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"season_template_sports_sports_season_id_sports_seasons_id_fk": {
"name": "season_template_sports_sports_season_id_sports_seasons_id_fk",
"tableFrom": "season_template_sports",
"tableTo": "sports_seasons",
"columnsFrom": [
"sports_season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.season_templates": {
"name": "season_templates",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"year": {
"name": "year",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"is_active": {
"name": "is_active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.seasons": {
"name": "seasons",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"league_id": {
"name": "league_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"year": {
"name": "year",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "season_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'pre_draft'"
},
"template_id": {
"name": "template_id",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"draft_rounds": {
"name": "draft_rounds",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 20
},
"flex_spots": {
"name": "flex_spots",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"draft_date_time": {
"name": "draft_date_time",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"draft_initial_time": {
"name": "draft_initial_time",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 120
},
"draft_increment_time": {
"name": "draft_increment_time",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 30
},
"current_pick_number": {
"name": "current_pick_number",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 1
},
"draft_started_at": {
"name": "draft_started_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"draft_paused": {
"name": "draft_paused",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"invite_code": {
"name": "invite_code",
"type": "varchar(20)",
"primaryKey": false,
"notNull": true
},
"points_for_1st": {
"name": "points_for_1st",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 100
},
"points_for_2nd": {
"name": "points_for_2nd",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 70
},
"points_for_3rd": {
"name": "points_for_3rd",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 50
},
"points_for_4th": {
"name": "points_for_4th",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 40
},
"points_for_5th": {
"name": "points_for_5th",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 25
},
"points_for_6th": {
"name": "points_for_6th",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 25
},
"points_for_7th": {
"name": "points_for_7th",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 15
},
"points_for_8th": {
"name": "points_for_8th",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 15
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"seasons_league_id_leagues_id_fk": {
"name": "seasons_league_id_leagues_id_fk",
"tableFrom": "seasons",
"tableTo": "leagues",
"columnsFrom": [
"league_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"seasons_template_id_season_templates_id_fk": {
"name": "seasons_template_id_season_templates_id_fk",
"tableFrom": "seasons",
"tableTo": "season_templates",
"columnsFrom": [
"template_id"
],
"columnsTo": [
"id"
],
"onDelete": "set null",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"seasons_invite_code_unique": {
"name": "seasons_invite_code_unique",
"nullsNotDistinct": false,
"columns": [
"invite_code"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.sports": {
"name": "sports",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"type": {
"name": "type",
"type": "sport_type",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"slug": {
"name": "slug",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"icon_url": {
"name": "icon_url",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"sports_slug_unique": {
"name": "sports_slug_unique",
"nullsNotDistinct": false,
"columns": [
"slug"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.sports_seasons": {
"name": "sports_seasons",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"sport_id": {
"name": "sport_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"year": {
"name": "year",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"start_date": {
"name": "start_date",
"type": "date",
"primaryKey": false,
"notNull": false
},
"end_date": {
"name": "end_date",
"type": "date",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "sports_season_status",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'upcoming'"
},
"scoring_type": {
"name": "scoring_type",
"type": "scoring_type",
"typeSchema": "public",
"primaryKey": false,
"notNull": true
},
"scoring_pattern": {
"name": "scoring_pattern",
"type": "scoring_pattern",
"typeSchema": "public",
"primaryKey": false,
"notNull": false
},
"total_majors": {
"name": "total_majors",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"majors_completed": {
"name": "majors_completed",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"qualifying_points_finalized": {
"name": "qualifying_points_finalized",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"elo_calibration_exponent": {
"name": "elo_calibration_exponent",
"type": "numeric(3, 2)",
"primaryKey": false,
"notNull": false
},
"elo_min_rating": {
"name": "elo_min_rating",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 1250
},
"elo_max_rating": {
"name": "elo_max_rating",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 1750
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"sports_seasons_sport_id_sports_id_fk": {
"name": "sports_seasons_sport_id_sports_id_fk",
"tableFrom": "sports_seasons",
"tableTo": "sports",
"columnsFrom": [
"sport_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.team_sport_scores": {
"name": "team_sport_scores",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"team_id": {
"name": "team_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"sports_season_id": {
"name": "sports_season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"total_points": {
"name": "total_points",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"participants_completed": {
"name": "participants_completed",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"participants_total": {
"name": "participants_total",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"calculated_at": {
"name": "calculated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"team_sport_scores_team_id_teams_id_fk": {
"name": "team_sport_scores_team_id_teams_id_fk",
"tableFrom": "team_sport_scores",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"team_sport_scores_sports_season_id_sports_seasons_id_fk": {
"name": "team_sport_scores_sports_season_id_sports_seasons_id_fk",
"tableFrom": "team_sport_scores",
"tableTo": "sports_seasons",
"columnsFrom": [
"sports_season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.team_standings": {
"name": "team_standings",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"team_id": {
"name": "team_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"total_points": {
"name": "total_points",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"current_rank": {
"name": "current_rank",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"previous_rank": {
"name": "previous_rank",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"first_place_count": {
"name": "first_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"second_place_count": {
"name": "second_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"third_place_count": {
"name": "third_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"fourth_place_count": {
"name": "fourth_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"fifth_place_count": {
"name": "fifth_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"sixth_place_count": {
"name": "sixth_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"seventh_place_count": {
"name": "seventh_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"eighth_place_count": {
"name": "eighth_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"participants_remaining": {
"name": "participants_remaining",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"calculated_at": {
"name": "calculated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"team_standings_team_id_teams_id_fk": {
"name": "team_standings_team_id_teams_id_fk",
"tableFrom": "team_standings",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"team_standings_season_id_seasons_id_fk": {
"name": "team_standings_season_id_seasons_id_fk",
"tableFrom": "team_standings",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.team_standings_snapshots": {
"name": "team_standings_snapshots",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"team_id": {
"name": "team_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"snapshot_date": {
"name": "snapshot_date",
"type": "date",
"primaryKey": false,
"notNull": true
},
"total_points": {
"name": "total_points",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": true,
"default": "'0'"
},
"rank": {
"name": "rank",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"first_place_count": {
"name": "first_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"second_place_count": {
"name": "second_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"third_place_count": {
"name": "third_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"fourth_place_count": {
"name": "fourth_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"fifth_place_count": {
"name": "fifth_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"sixth_place_count": {
"name": "sixth_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"seventh_place_count": {
"name": "seventh_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"eighth_place_count": {
"name": "eighth_place_count",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"participants_remaining": {
"name": "participants_remaining",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"actual_points": {
"name": "actual_points",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": false
},
"projected_points": {
"name": "projected_points",
"type": "numeric(10, 2)",
"primaryKey": false,
"notNull": false
},
"participants_finished": {
"name": "participants_finished",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"team_standings_snapshots_team_id_teams_id_fk": {
"name": "team_standings_snapshots_team_id_teams_id_fk",
"tableFrom": "team_standings_snapshots",
"tableTo": "teams",
"columnsFrom": [
"team_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"team_standings_snapshots_season_id_seasons_id_fk": {
"name": "team_standings_snapshots_season_id_seasons_id_fk",
"tableFrom": "team_standings_snapshots",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.teams": {
"name": "teams",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"season_id": {
"name": "season_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"logo_url": {
"name": "logo_url",
"type": "varchar(512)",
"primaryKey": false,
"notNull": false
},
"owner_id": {
"name": "owner_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"teams_season_id_seasons_id_fk": {
"name": "teams_season_id_seasons_id_fk",
"tableFrom": "teams",
"tableTo": "seasons",
"columnsFrom": [
"season_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.users": {
"name": "users",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"clerk_id": {
"name": "clerk_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true
},
"username": {
"name": "username",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"display_name": {
"name": "display_name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"first_name": {
"name": "first_name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"last_name": {
"name": "last_name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false
},
"image_url": {
"name": "image_url",
"type": "varchar(512)",
"primaryKey": false,
"notNull": false
},
"is_admin": {
"name": "is_admin",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"users_clerk_id_unique": {
"name": "users_clerk_id_unique",
"nullsNotDistinct": false,
"columns": [
"clerk_id"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {
"public.autodraft_mode": {
"name": "autodraft_mode",
"schema": "public",
"values": [
"next_pick",
"while_on"
]
},
"public.event_type": {
"name": "event_type",
"schema": "public",
"values": [
"playoff_game",
"major_tournament",
"final_standings"
]
},
"public.picked_by_type": {
"name": "picked_by_type",
"schema": "public",
"values": [
"owner",
"commissioner",
"auto"
]
},
"public.probability_source": {
"name": "probability_source",
"schema": "public",
"values": [
"manual",
"futures_odds",
"elo_simulation",
"performance_model"
]
},
"public.scoring_pattern": {
"name": "scoring_pattern",
"schema": "public",
"values": [
"single_elimination_playoff",
"page_playoff",
"season_standings",
"qualifying_points"
]
},
"public.scoring_type": {
"name": "scoring_type",
"schema": "public",
"values": [
"playoffs",
"regular_season",
"majors"
]
},
"public.season_status": {
"name": "season_status",
"schema": "public",
"values": [
"pre_draft",
"draft",
"active",
"completed"
]
},
"public.sport_type": {
"name": "sport_type",
"schema": "public",
"values": [
"team",
"individual"
]
},
"public.sports_season_status": {
"name": "sports_season_status",
"schema": "public",
"values": [
"upcoming",
"active",
"completed"
]
}
},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}