From 2d6ab9782024a583149f625e8c681a6af993967d Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 8 Jun 2024 03:57:47 +0200 Subject: [PATCH] fix: try to remove duplicates with group-by --- upub/core/src/selector.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/upub/core/src/selector.rs b/upub/core/src/selector.rs index ed3fdec5..5c1680a7 100644 --- a/upub/core/src/selector.rs +++ b/upub/core/src/selector.rs @@ -17,6 +17,7 @@ impl Query { .add(model::activity::Column::Id.is_not_null()) .add(model::object::Column::Id.is_not_null()) ) + .group_by(model::activity::Column::Internal) .order_by(model::addressing::Column::Published, Order::Desc) .select_only(); @@ -45,6 +46,7 @@ impl Query { let mut select = model::addressing::Entity::find() // .distinct() .join(sea_orm::JoinType::InnerJoin, model::addressing::Relation::Objects.def()) + .group_by(model::object::Column::Internal) .order_by(model::addressing::Column::Published, Order::Desc) .select_only();