Skip to content

Commit 41936c8

Browse files
Update packages/scripts/src/migrations/2025.10.13T14.22.21.migrate-sync-watch-data.ts
Co-authored-by: Copilot <[email protected]>
1 parent 6eac53b commit 41936c8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

packages/scripts/src/migrations/2025.10.13T14.22.21.migrate-sync-watch-data.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ export default class Migration implements RunnableMigration<MigrationContext> {
6363
}),
6464
]);
6565

66-
const result = await mongoService.watch.insertMany(watchDocuments, {
67-
session,
68-
});
69-
70-
migratedCount += result.insertedCount;
66+
if (watchDocuments.length > 0) {
67+
const result = await mongoService.watch.insertMany(watchDocuments, {
68+
session,
69+
});
70+
migratedCount += result.insertedCount;
71+
}
7172
}
7273

7374
logger.info(

0 commit comments

Comments
 (0)