diff options
Diffstat (limited to 'planetwars-server')
-rw-r--r-- | planetwars-server/src/db/matches.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/planetwars-server/src/db/matches.rs b/planetwars-server/src/db/matches.rs index 6590a37..39b7d9b 100644 --- a/planetwars-server/src/db/matches.rs +++ b/planetwars-server/src/db/matches.rs @@ -97,6 +97,10 @@ pub fn list_matches(conn: &PgConnection) -> QueryResult<Vec<FullMatchData>> { .on(match_players::bot_version_id.eq(bot_versions::id.nullable())), ) .left_join(bots::table.on(bot_versions::bot_id.eq(bots::id.nullable()))) + .order_by(( + match_players::match_id.asc(), + match_players::player_id.asc(), + )) .load::<FullMatchPlayerData>(conn)? .grouped_by(&matches); @@ -150,6 +154,7 @@ pub fn find_match(id: i32, conn: &PgConnection) -> QueryResult<FullMatchData> { .on(match_players::bot_version_id.eq(bot_versions::id.nullable())), ) .left_join(bots::table.on(bot_versions::bot_id.eq(bots::id.nullable()))) + .order_by(match_players::player_id.asc()) .load::<FullMatchPlayerData>(conn)?; let res = FullMatchData { |