diff --git a/src/interfaces/database/models/matchmaking_choice.rs b/src/interfaces/database/models/matchmaking_choice.rs index 682acc6e..c8c024b3 100644 --- a/src/interfaces/database/models/matchmaking_choice.rs +++ b/src/interfaces/database/models/matchmaking_choice.rs @@ -7,7 +7,7 @@ use diesel::serialize::{IsNull, ToSql}; use super::super::schema::sql_types; -#[derive(Debug, Clone, Copy, PartialEq, FromSqlRow, AsExpression)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, FromSqlRow, AsExpression)] #[diesel(sql_type = sql_types::MatchmakingChoice)] pub enum MatchmakingChoice { Yes, diff --git a/src/interfaces/database/models/matchmaking_replies.rs b/src/interfaces/database/models/matchmaking_replies.rs index fa365e4c..e88692cb 100644 --- a/src/interfaces/database/models/matchmaking_replies.rs +++ b/src/interfaces/database/models/matchmaking_replies.rs @@ -33,6 +33,7 @@ impl MatchmakingReply { .filter(matchmaking_replies::matchmaking_id.eq(matchmaking_id)) .inner_join(users::table.on(matchmaking_replies::user_id.eq(users::id))) .inner_join(telegram::table.on(users::id.eq(telegram::user_id))) + .order_by(matchmaking_replies::choice) .get_results::<(Self, RoyalnetUser, TelegramUser)>(database) .context("Non รจ stato possibile recuperare le risposte al matchmaking dal database RYG.") }