fix(facilities): five screens queried a reservations column that does not exist
`reservations` identifies its booker with booker_type plus player_id / member_id.
There is no booker_id column — confirmed with SHOW COLUMNS on the live database,
not from the migrations. Five call sites queried it anyway, so every one of them
threw a SQL error:
FacilityDashboards/Controllers/FacilityDashboardController.php (x2)
PlaygroundAdmin/Services/ClubDashboardService.php (x2)
PlaygroundAdmin/Services/PlaygroundMirrorService.php (x3)
FacilityGrids/Services/PoolFinancialService.php (x1)
PlayerApi/Services/PlayerBookingService.php (x4)
Effect: the facility dashboard, the club-wide playground dashboard, the pool
financial panel and the playground mirror hard-500 on every load, and the player
app could never create a booking — the INSERT named booker_id too. That matches
the data: 7 reservations exist with booker_type set and player_id/member_id both
NULL, and zero player bookings.
Reads become COALESCE(player_id, member_id); the joins key on the specific column
for their booker_type; the INSERT writes player_id.
Also PlaygroundMirrorService queried private_match_bookings.match_date, which is
booking_date on that table. (live_matches genuinely has match_date, so MatchCenter
is untouched.) And sa_bookings / pool_bookings really do have booker_id, so those
references are correct and left alone.
Every rewritten query was executed against the live database before committing.
Co-Authored-By:
Claude Opus 5 (1M context) <noreply@anthropic.com>
Showing
Please register or sign in to comment