fix: First time migration fails (Regressed in #9345) (#9353)

This commit is contained in:
Tom Moor
2025-05-31 16:46:39 -04:00
committed by GitHub
parent 76bd503581
commit f6d9d00947

View File

@@ -109,12 +109,18 @@ class CollectionIndexCollisionResolver {
}
export default async function main(exit = false) {
await Team.findAllInBatches<Team>({ batchLimit: 5 }, async (teams) => {
for (const team of teams) {
const resolver = new CollectionIndexCollisionResolver(team.id);
await resolver.process();
await Team.findAllInBatches<Team>(
{
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);