remove adjacent relations sorting as it is not necessary

This commit is contained in:
Marc-Roig 2022-11-20 10:50:31 +01:00
parent 114d67a9f2
commit c3c8f40d5b
2 changed files with 1 additions and 2 deletions

View File

@ -869,7 +869,6 @@ const createEntityManager = (db) => {
],
})
.where(joinTable.on || {})
.sort(orderColumnName, 'ASC')
.transacting(trx)
.execute();

View File

@ -40,7 +40,7 @@ const relationsOrderer = (initArr, idColumn, orderColumn) => {
order: r[orderColumn],
}));
const maxOrder = _.maxBy('order', arr).order;
const maxOrder = _.maxBy('order', arr)?.order || 0;
// TODO: Improve performance by using a map
const findRelation = (id) => {