claude-configs/skills/paper-dynasty/reference/database-schema.md
Cal Corum 8a1d15911f Initial commit: Claude Code configuration backup
Version control Claude Code configuration including:
- Global instructions (CLAUDE.md)
- User settings (settings.json)
- Custom agents (architect, designer, engineer, etc.)
- Custom skills (create-skill templates and workflows)

Excludes session data, secrets, cache, and temporary files per .gitignore.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 16:34:21 -06:00

105 lines
2.7 KiB
Markdown

# Paper Dynasty Database Schema Reference
**Load this when**: You need details about database models, cardset IDs, pack types, or rarity values.
---
## Core Models
**Teams** (`Team`):
- Regular teams (season-based, permanent)
- Gauntlet teams (temporary, event-specific, abbrev contains "Gauntlet")
- Fields: `id`, `abbrev`, `lname`, `season`, `wallet`, `ranking`
**Players** (`Player`):
- Baseball players with card variants
- Fields: `player_id`, `p_name`, `cardset`, `rarity`, `cost`, positions
- Linked to: `BattingCard`, `PitchingCard`, `CardPosition`
**Cards** (`Card`):
- Individual card instances owned by teams
- Fields: `id`, `player`, `team`, `pack`, `value`
- Team can be NULL (unassigned/wiped cards)
**Packs** (`Pack`):
- Card packs owned by teams
- Fields: `id`, `team`, `pack_type`, `open_time`
**Gauntlet Runs** (`GauntletRun`):
- Tournament run tracking
- Fields: `id`, `team`, `gauntlet` (event_id), `wins`, `losses`, `created`, `ended`
- Active run: `ended == 0`
- Ended run: `ended > 0` (timestamp)
**Results** (`Result`):
- Game outcomes
- Fields: `away_team`, `home_team`, scores, `season`, `week`, `ranked`
**Stats**:
- `BattingStat`: Plate appearance stats per game
- `PitchingStat`: Pitching stats per game
---
## Cardsets
**Current Live Cardset**: 27 (2005 Live)
**Known Cardsets** (ID: Name):
| ID | Name | Status |
|----|------|--------|
| 24 | 2025 Season | Ranked Legal, In Packs |
| 25 | 2025 Promos | Ranked Legal, In Packs |
| 26 | 2025 Custom | Ranked Legal, In Packs |
| 27 | 2005 Live | Ranked Legal, In Packs |
| 28 | 2005 Promos | Ranked Legal, In Packs |
| 29 | 2005 Custom | Ranked Legal, In Packs |
**Ranked Legal Cardsets**: [24, 25, 26, 27, 28, 29]
**Gauntlet Events**: Have specific cardset configurations
*Note: Cardset IDs are static - expand this reference as we discover new cardsets via `api.get('cardsets')`*
---
## Pack Types
**Complete Pack Type Reference** (ID: Name):
| ID | Name | Description |
|----|------|-------------|
| 1 | Standard | Default pack type |
| 2 | Starter | Starter deck pack |
| 3 | Premium | Premium pack |
| 4 | Check-In Player | Daily check-in reward |
| 5 | MVP | MVP-only pack |
| 6 | All Star | All-Star pack |
| 7 | Mario | Special Mario pack |
| 8 | Team Choice | 1 card, choice of 4 from selected MLB club |
| 9 | Promo Choice | Promotional choice pack |
**Default Pack Type**: 1 (Standard) for most operations
---
## Rarities
From lowest to highest:
| Rank | Rarity |
|------|--------|
| 1 | Replacement |
| 2 | Reserve |
| 3 | Starter |
| 4 | All-Star |
| 5 | MVP |
| 6 | Hall of Fame |
---
## Related Files
- **Full Schema**: `/mnt/NV2/Development/paper-dynasty/database/app/db_engine.py`
- **API Models**: `/mnt/NV2/Development/paper-dynasty/database/app/routers_v2/`