feat: many-to-many player-team assignments (junction table migration) #124
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/basketball-api#124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
plan-wkq→ Phase 11 → discovered scope (boys team announcements require multi-team players)Repo
forgejo_admin/basketball-apiUser Story
As an admin
I want to assign a player to multiple teams simultaneously
So that players like Seydou Goudiaby can be rostered on 17U Elite, Select, and Local
Context
Currently
Player.team_idis a single FK toteams.id— one player, one team. Seydou Goudiaby needs to be on all three 17U boys teams. This requires a many-to-many relationship via a junction table. The draft board, roster endpoints, email queries, and team assignment routes all referenceplayer.team_iddirectly and must be updated.File Targets
Files the agent should modify or create:
src/basketball_api/models.py— addplayer_teamsassociation table, update Player.teams relationship, remove Player.team_id FKalembic/versions/xxx_player_teams_junction.py— migration: create junction table, migrate data, drop columnsrc/basketball_api/routes/teams.py— update assign/unassign endpoints to use junction tablesrc/basketball_api/routes/roster.py— update roster queries for many-to-manysrc/basketball_api/routes/admin.py— update draft board GET/POST (/admin/teams,/admin/teams/save), email queriesFiles the agent should NOT touch:
src/basketball_api/services/email.py— separate issue for team announcement emailAcceptance Criteria
Test Expectations
pytest tests/ -vConstraints
player.teamconvenience property if possible for backwards compat during transitiontofu plan -lock=falseN/A — pure API changeChecklist
Related
Westside Basketball— project