aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db/matches.rs
diff options
context:
space:
mode:
Diffstat (limited to 'planetwars-server/src/db/matches.rs')
-rw-r--r--planetwars-server/src/db/matches.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/planetwars-server/src/db/matches.rs b/planetwars-server/src/db/matches.rs
index 54fd113..d9d893c 100644
--- a/planetwars-server/src/db/matches.rs
+++ b/planetwars-server/src/db/matches.rs
@@ -6,7 +6,7 @@ use diesel::{
};
use diesel::{Connection, GroupedBy, PgConnection, QueryResult};
-use crate::schema::{bots, code_bundles, match_players, matches};
+use crate::schema::{bot_versions, bots, match_players, matches};
use super::bots::{Bot, CodeBundle};
@@ -93,10 +93,10 @@ pub fn list_matches(conn: &PgConnection) -> QueryResult<Vec<FullMatchData>> {
let match_players = MatchPlayer::belonging_to(&matches)
.left_join(
- code_bundles::table
- .on(match_players::code_bundle_id.eq(code_bundles::id.nullable())),
+ bot_versions::table
+ .on(match_players::code_bundle_id.eq(bot_versions::id.nullable())),
)
- .left_join(bots::table.on(code_bundles::bot_id.eq(bots::id.nullable())))
+ .left_join(bots::table.on(bot_versions::bot_id.eq(bots::id.nullable())))
.load::<FullMatchPlayerData>(conn)?
.grouped_by(&matches);
@@ -146,10 +146,10 @@ pub fn find_match(id: i32, conn: &PgConnection) -> QueryResult<FullMatchData> {
let match_players = MatchPlayer::belonging_to(&match_base)
.left_join(
- code_bundles::table
- .on(match_players::code_bundle_id.eq(code_bundles::id.nullable())),
+ bot_versions::table
+ .on(match_players::code_bundle_id.eq(bot_versions::id.nullable())),
)
- .left_join(bots::table.on(code_bundles::bot_id.eq(bots::id.nullable())))
+ .left_join(bots::table.on(bot_versions::bot_id.eq(bots::id.nullable())))
.load::<FullMatchPlayerData>(conn)?;
let res = FullMatchData {