1
0
Fork 0
forked from alemi/upub

fix: maybe fix for postgres distinct

maybe adding internal to order will make it respect the distinct constraint?
This commit is contained in:
əlemi 2024-06-08 06:03:36 +02:00
parent 972ef97721
commit 1fd31bc7be
Signed by: alemi
GPG key ID: A4895B84D311642C
2 changed files with 4 additions and 2 deletions

View file

@ -1,8 +1,8 @@
use std::{collections::BTreeSet, sync::Arc};
use sea_orm::{ColumnTrait, DatabaseConnection, DbErr, EntityTrait, QueryFilter, QuerySelect, SelectColumns};
use sea_orm::{DatabaseConnection, DbErr};
use crate::{config::Config, ext::AnyQuery, model};
use crate::{config::Config, model};
use uriproxy::UriClass;
#[derive(Clone)]

View file

@ -21,6 +21,7 @@ impl Query {
.add(model::object::Column::Id.is_not_null())
)
.order_by(model::addressing::Column::Published, Order::Desc)
.order_by(model::activity::Column::Internal, Order::Desc)
.select_only();
for col in model::activity::Column::iter() {
@ -52,6 +53,7 @@ impl Query {
])
.join(sea_orm::JoinType::InnerJoin, model::addressing::Relation::Objects.def())
.order_by(model::addressing::Column::Published, Order::Desc)
.order_by(model::object::Column::Internal, Order::Desc)
.select_only();
for col in model::object::Column::iter() {