Naming Audit — Schema v2

Naming Audit

During the v2 review, the following naming clusters were identified as sources of confusion. Every rename below is recorded here with its rationale.

[Diagram]

Cluster 1: fantasy_team_* prefix overloading (5 tables)

Table (current) Renamed to Concern
fantasy_teams (unchanged) The fantasy construct itself. Clear, keep.
fantasy_team_players fantasy_roster_entries The roster. Stores real clubs, not "players". Every new dev is misled by this name. The roster_entries namespace groups it with the lineup system.
fantasy_team_games_played fantasy_roster_games Roster-adjacent. Tracks games played per roster entry per window. The roster_ prefix makes the relationship explicit.
fantasy_team_window_points fantasy_team_points Scoring. The "window" qualifier is redundant — all points are per-window by context. Shortened for readability.
fantasy_team_rankings fantasy_rankings Standings. The "team" qualifier is redundant — only fantasy teams are ranked. Shortened for readability.

New namespace structure:

fantasy_teams           ← the construct
fantasy_roster_entries  ← what clubs the fantasy team owns
fantasy_roster_games    ← game tracking for each roster entry
window_lineups          ← which roster entries are active this window
fantasy_team_points     ← points scored per window
fantasy_rankings        ← league-wide rankings per window

The roster_* sub-namespace groups the three tables that manage the roster lifecycle: ownership (roster_entries) → activation per window (window_lineups) → game tracking (roster_games).

Cluster 2: league_* prefix ambiguity (2 tables)

Now that real-world competitions are soccer_leagues, the un-prefixed league_* tables are ambiguous:

Table (current) Renamed to Reason
league_standings soccer_league_standings Entirely about real-world standings — only references soccer_leagues.
league_game_limits fantasy_league_game_limits Junction table linking fantasy_leagues to soccer_leagues. The fantasy_ prefix is correct because each row is configured per fantasy league.

Cluster 3: Generic names (1 table)

Table (current) Renamed to Reason
matches soccer_matches Consistency with the soccer_* prefix now used for all real-world entities.

§1 — Naming: soccer_teams and soccer_leagues

Applied. The document now uses soccer_teams and soccer_leagues consistently for real-world entities. Current code files retain legacy names; migration will rename:

Current file Will become
src/db/schema/teams.ts src/db/schema/soccer_teams.ts
src/db/schema/leagues.ts src/db/schema/soccer_leagues.ts

§6 — Comprehensive Naming Audit

Applied. The full Naming Audit section (see above) documents all renames with rationale, organized into three clusters:

Cluster Tables affected Resolution
fantasy_team_* prefix overloading 5 tables Roster sub-namespace created: fantasy_roster_entries, fantasy_roster_games. Shortened: fantasy_team_points, fantasy_rankings. fantasy_teams unchanged.
league_* prefix ambiguity 2 tables soccer_league_standings (real-world), fantasy_league_game_limits (junction table)
Generic names 1 table soccer_matches for consistency with soccer_* prefix

Migration checklist:

Current code file Target file
src/db/schema/fantasy_team_players.ts src/db/schema/fantasy_roster_entries.ts
src/db/schema/fantasy_team_games_played.ts src/db/schema/fantasy_roster_games.ts
src/db/schema/fantasy_team_window_points.ts src/db/schema/fantasy_team_points.ts
src/db/schema/fantasy_team_rankings.ts src/db/schema/fantasy_rankings.ts
src/db/schema/league_standings.ts src/db/schema/soccer_league_standings.ts
src/db/schema/league_game_limits.ts src/db/schema/fantasy_league_game_limits.ts
src/db/schema/matches.ts src/db/schema/soccer_matches.ts