Refactor Roster model from 26 FK columns to a junction table #29
Labels
No Label
ai-changes-requested
ai-failed
ai-merged
ai-pr-opened
ai-reviewed
ai-reviewing
ai-reviewing
ai-working
bug
enhancement
evolution
performance
phase-0
phase-1a
phase-1b
phase-1c
phase-1d
security
tech-debt
todo
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-database#29
Loading…
Reference in New Issue
Block a user
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?
`app/db_engine.py:497-543`. `Roster` stores lineup slots as `card_1` through `card_26` as individual foreign key columns. Makes it impossible to query "which rosters contain card X" efficiently. Consider a standard junction table `(roster_id, slot, card_id)`.
Priority: low
PR #58 opened: #58
Approach: Added a
RosterSlotjunction table(roster, slot, card)with a unique index on(roster, slot). Removed the 26 FK columns from theRosterORM model and replaced the commented-outget_cards()stub with a working implementation that JOINs throughRosterSlot.A migration script at
migrations/migrate_roster_junction_table.pyreads the legacycard_N_idcolumns via raw SQL and backfills the new table. The legacy columns remain in the DB schema until an operator drops them after verifying the migration.