Fix model order (#8250)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2025-03-17 16:52:05 +05:00 committed by GitHub
parent e092c3ae80
commit 2c8f3c80bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -1619,7 +1619,7 @@ class MongoTxAdapter extends MongoAdapterBase implements TxAdapter {
@withContext('get-model')
async getModel (ctx: MeasureContext): Promise<Tx[]> {
const txCollection = this.db.collection<Tx>(DOMAIN_MODEL_TX)
const cursor = txCollection.find({}, { sort: { _id: 1, modifiedOn: 1 } })
const cursor = txCollection.find({}, { sort: { modifiedOn: 1, _id: 1 } })
const model = await toArray<Tx>(cursor)
// We need to put all core.account.System transactions first
const systemTx: Tx[] = []

View File

@ -2093,7 +2093,7 @@ class PostgresTxAdapter extends PostgresAdapterBase implements TxAdapter {
SELECT *
FROM "${translateDomain(DOMAIN_MODEL_TX)}"
WHERE "workspaceId" = $1::uuid
ORDER BY _id::text ASC, "modifiedOn"::bigint ASC
ORDER BY "modifiedOn"::bigint ASC, _id::text ASC
`
return client.execute(query, [this.workspaceId])
})