- Migration (0114): TRUNCATE season_template_sports before adding NOT NULL sport_id
column to prevent failure on non-empty tables
- findDraftableSportsSeasonBySportId: add orderBy(year DESC, draftOn DESC) so the
newest season is returned deterministically when multiple draft windows overlap
- leagues/new.tsx loader: build a Map from the already-fetched allSportsSeasons
instead of firing N×M per-sport DB queries (eliminates ~30 redundant queries)
- schema: add UNIQUE(templateId, sportId) on season_template_sports to prevent
duplicate sport entries via concurrent requests
- schema: add UNIQUE(name) on season_templates so import merge-mode lookup by
name is unambiguous (migration 0115)
https://claude.ai/code/session_01CoRLHERakMncbPs877izvw
Templates previously referenced specific sports seasons (e.g. "NFL 2026"), requiring
admins to create a new template every year. Templates now reference sports directly
(e.g. "NFL") and resolve to the currently-draftable season at league-creation time.
- Remove `year` field from season_templates table
- Replace `sportsSeasonId` FK with `sportId` FK in season_template_sports
- applySportsFromTemplate now resolves each sport to its active draftable season
- Admin template UI updated to manage sports (not specific seasons)
- sports-data-sync export/import updated to the new sport-centric format
https://claude.ai/code/session_01CoRLHERakMncbPs877izvw