Skip to content

Simplify data model#5

Draft
chengh42 wants to merge 4 commits into
mainfrom
model
Draft

Simplify data model#5
chengh42 wants to merge 4 commits into
mainfrom
model

Conversation

@chengh42

@chengh42 chengh42 commented Apr 14, 2026

Copy link
Copy Markdown
Member

Description

Cleans up the data model before backfilling data:

  • Season: removes id (int PK), is_active, is_published, published_atname (e.g. 2025-2026) is now the PK, enforced by a Pydantic validator and a Postgres CHECK constraint in the migration
  • Teams: removes the unused Team ORM model and teams DB table; team data is hardcoded in app/services/teams.py (TeamInfo). Renamed is_nbbuse_nbb_ref, needs_tafel3use_24s. Added team_id (foys.io ID) per team. Renamed team_mapping.pyteams.py
  • Game → Match: renamed Game ORM model to Match, DB table gamesmatches, join table game_timeslotsmatch_timeslots. API routes updated: /seasons/{name}/games/seasons/{name}/matches. SyncLog columns games_added/updated/removedmatches_added/updated/removed
  • match_id non-null: matches.match_id is now NOT NULL — all rows come from foys.io and always have an ID
  • All FK columns referencing seasons.id (int) updated to reference seasons.name (string)
  • Route path params updated from season_id: int to season_name: str

Jira / Figma / Other References

N/A

Manual Testing Plan & New UI Screenshots:

All 43 existing tests pass. No manual testing needed — changes are model/schema only with no new behaviour.

@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
usbasketball-taken Ready Ready Preview, Comment Apr 14, 2026 8:55pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant