Fix migration order: move gamerewards after player table

gamerewards has a FK to player (player_id), so it must be migrated
after the player table. Previously this caused the Pablo Sanchez Card
reward (id=9, player_id=9399) to fail with FK violation.
This commit is contained in:
Cal Corum 2026-01-27 10:41:54 -06:00
parent 392833a5d9
commit 94c8564282

View File

@ -57,10 +57,11 @@ MIGRATION_ORDER = [
# Tier 2: Simple FK dependencies (single level)
"cardset", # -> event
"mlbplayer", # no FKs
"gamerewards", # -> packtype, player (but player not created yet, so nullable)
# Tier 3: Core entity tables
"team", # -> event
"player", # -> cardset, rarity, mlbplayer
# Tier 3b: Tables dependent on player
"gamerewards", # -> packtype, player
# Tier 4: Dependent on core entities
"pack", # -> team, packtype, cardset
"card", # -> player, team, pack