FAForever / faf-league-service

The league service of Forged Alliance Forever
GNU General Public License v3.0
0 stars 0 forks source link

Handle NULL scores before placement #6

Closed cleborys closed 4 years ago

cleborys commented 4 years ago

Make sure players' game_count is saved correctly before they are placed. This requires saving LeagueScores with division_id and score set to None for players who haven't been placed yet.

Also needed to adjust the database schema to the new league_rater conventions: In league_season_division min_rating, max_rating, highest_score may not be null, so that comparisons in the rater don't fail. In league_season_score division and score may now be null to save score before placement.

I don't like that we currently have to enforce some data consistency on write, since league_season_score carries both a season_id and a division_id, which has its own season_id attached. It would be better not to duplicate this information. The plain season_id is needed to be able to store scores without division before placement.

Closes #4