From f6d9d0094752ae81c3a5cd0f807c7477ed1a24b9 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 31 May 2025 16:46:39 -0400 Subject: [PATCH] fix: First time migration fails (Regressed in #9345) (#9353) --- ...062414-resolve-collection-index-collisions.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/server/scripts/20250327062414-resolve-collection-index-collisions.ts b/server/scripts/20250327062414-resolve-collection-index-collisions.ts index 9ef5364824..08073583de 100644 --- a/server/scripts/20250327062414-resolve-collection-index-collisions.ts +++ b/server/scripts/20250327062414-resolve-collection-index-collisions.ts @@ -109,12 +109,18 @@ class CollectionIndexCollisionResolver { } export default async function main(exit = false) { - await Team.findAllInBatches({ batchLimit: 5 }, async (teams) => { - for (const team of teams) { - const resolver = new CollectionIndexCollisionResolver(team.id); - await resolver.process(); + await Team.findAllInBatches( + { + attributes: ["id"], + batchLimit: 5, + }, + async (teams) => { + for (const team of teams) { + const resolver = new CollectionIndexCollisionResolver(team.id); + await resolver.process(); + } } - }); + ); if (exit) { process.exit(0);