Files
OpenFUT-Core/migrations/0006_seasons_loans_packs.sql
funman300 e438b58d88
CI / Build, lint & test (push) Failing after 2m10s
Phase 25: division leaderboard, market trade history
- Market: record buy/sell history in market_history table; expose via
  GET /market/trade-history (last 30 events, newest first)
- Division: GET /division/leaderboard returns 10-club table with 9 seeded
  NPC entries + player row, sorted by pts; stable within a season
- rand feature small_rng enabled in Cargo.toml for SmallRng use
- 3 new integration tests (leaderboard count, sort order, empty trade history)
- Core: 96 tests passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 19:13:10 -07:00

20 lines
731 B
SQL

-- Division / season tracking (one row per profile, reset each season)
CREATE TABLE IF NOT EXISTS seasons (
profile_id TEXT PRIMARY KEY,
division INTEGER NOT NULL DEFAULT 5,
season_number INTEGER NOT NULL DEFAULT 1,
season_points INTEGER NOT NULL DEFAULT 0,
matches_played INTEGER NOT NULL DEFAULT 0,
wins INTEGER NOT NULL DEFAULT 0,
draws INTEGER NOT NULL DEFAULT 0,
losses INTEGER NOT NULL DEFAULT 0,
started_at TEXT NOT NULL
);
-- Pack open history: store which card_ids came out of each open
ALTER TABLE packs ADD COLUMN opened_cards TEXT;
ALTER TABLE packs ADD COLUMN opened_at TEXT;
-- Club cosmetic customization
ALTER TABLE clubs ADD COLUMN manager_name TEXT DEFAULT 'Player Manager';