fix: ops wrong relation direction

This commit is contained in:
əlemi 2024-04-21 16:39:56 +02:00
parent a083edef6e
commit 645e14cc32
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -120,8 +120,6 @@ impl Entity {
.distinct() .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
// TODO we could in theory return just the link or fetch them again, just ignoring them is mehh
.join(sea_orm::JoinType::LeftJoin, crate::model::activity::Relation::Object.def()); .join(sea_orm::JoinType::LeftJoin, crate::model::activity::Relation::Object.def());
for col in crate::model::activity::Column::iter() { for col in crate::model::activity::Column::iter() {
@ -140,9 +138,7 @@ impl Entity {
.distinct() .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 object anymore .join(sea_orm::JoinType::LeftJoin, crate::model::object::Relation::Activity.def());
// TODO we could in theory return just the link or fetch them again, just ignoring them is mehh
.join(sea_orm::JoinType::LeftJoin, crate::model::object::Relation::Activity.def().rev());
for col in crate::model::object::Column::iter() { for col in crate::model::object::Column::iter() {
select = select.select_column_as(col, format!("{}{}", crate::model::object::Entity.table_name(), col.to_string())); select = select.select_column_as(col, format!("{}{}", crate::model::object::Entity.table_name(), col.to_string()));