fix: maybe fix for postgres distinct
maybe adding internal to order will make it respect the distinct constraint?
This commit is contained in:
parent
972ef97721
commit
1fd31bc7be
2 changed files with 4 additions and 2 deletions
|
@ -1,8 +1,8 @@
|
||||||
use std::{collections::BTreeSet, sync::Arc};
|
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;
|
use uriproxy::UriClass;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
@ -21,6 +21,7 @@ impl Query {
|
||||||
.add(model::object::Column::Id.is_not_null())
|
.add(model::object::Column::Id.is_not_null())
|
||||||
)
|
)
|
||||||
.order_by(model::addressing::Column::Published, Order::Desc)
|
.order_by(model::addressing::Column::Published, Order::Desc)
|
||||||
|
.order_by(model::activity::Column::Internal, Order::Desc)
|
||||||
.select_only();
|
.select_only();
|
||||||
|
|
||||||
for col in model::activity::Column::iter() {
|
for col in model::activity::Column::iter() {
|
||||||
|
@ -52,6 +53,7 @@ impl Query {
|
||||||
])
|
])
|
||||||
.join(sea_orm::JoinType::InnerJoin, model::addressing::Relation::Objects.def())
|
.join(sea_orm::JoinType::InnerJoin, model::addressing::Relation::Objects.def())
|
||||||
.order_by(model::addressing::Column::Published, Order::Desc)
|
.order_by(model::addressing::Column::Published, Order::Desc)
|
||||||
|
.order_by(model::object::Column::Internal, Order::Desc)
|
||||||
.select_only();
|
.select_only();
|
||||||
|
|
||||||
for col in model::object::Column::iter() {
|
for col in model::object::Column::iter() {
|
||||||
|
|
Loading…
Reference in a new issue