mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-07 00:09:34 +00:00
Migration fix (#1154)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
0d2221e567
commit
5abfbe64ac
@ -41,6 +41,10 @@ async function migrateSpaces (client: MigrationUpgradeClient): Promise<void> {
|
|||||||
let updateTxes = await client.findAll(core.class.TxUpdateDoc, {
|
let updateTxes = await client.findAll(core.class.TxUpdateDoc, {
|
||||||
objectClass: { $in: descendants },
|
objectClass: { $in: descendants },
|
||||||
objectId: { $nin: [...currentSpaces, ...removedSpaces] }
|
objectId: { $nin: [...currentSpaces, ...removedSpaces] }
|
||||||
|
}, {
|
||||||
|
sort: {
|
||||||
|
modifiedOn: 1
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// TXes already stored, avoid dublicate id error
|
// TXes already stored, avoid dublicate id error
|
||||||
updateTxes = updateTxes.map((p) => {
|
updateTxes = updateTxes.map((p) => {
|
||||||
@ -49,7 +53,9 @@ async function migrateSpaces (client: MigrationUpgradeClient): Promise<void> {
|
|||||||
space: core.space.DerivedTx
|
space: core.space.DerivedTx
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
await Promise.all(updateTxes.map(async (tx) => await client.tx(tx)))
|
for (const tx of updateTxes) {
|
||||||
|
await client.tx(tx)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const coreOperation: MigrateOperation = {
|
export const coreOperation: MigrateOperation = {
|
||||||
|
Loading…
Reference in New Issue
Block a user