fix: try to remove duplicates with group-by

This commit is contained in:
əlemi 2024-06-08 03:57:47 +02:00
parent aa953a71f8
commit 2d6ab97820
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -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();