fix: attempt to select only one addressing

This commit is contained in:
əlemi 2024-04-15 22:10:49 +02:00
parent c28b5fd49c
commit d5a83a5c7c
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -85,6 +85,7 @@ impl FromQueryResult for EmbeddedActivity {
impl Entity { impl Entity {
pub fn find_activities() -> Select<Entity> { pub fn find_activities() -> Select<Entity> {
let mut select = Entity::find() let mut select = Entity::find()
.distinct()
.select_only() .select_only()
.join(sea_orm::JoinType::InnerJoin, Relation::Activity.def()) .join(sea_orm::JoinType::InnerJoin, Relation::Activity.def())
// INNERJOIN: filter out addressings for which we don't have an activity anymore // INNERJOIN: filter out addressings for which we don't have an activity anymore
@ -104,6 +105,7 @@ impl Entity {
pub fn find_objects() -> Select<Entity> { pub fn find_objects() -> Select<Entity> {
let mut select = Entity::find() let mut select = Entity::find()
.distinct()
.select_only() .select_only()
.join(sea_orm::JoinType::InnerJoin, Relation::Object.def()); .join(sea_orm::JoinType::InnerJoin, Relation::Object.def());
// INNERJOIN: filter out addressings for which we don't have an activity anymore // INNERJOIN: filter out addressings for which we don't have an activity anymore