We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 300a1e7 commit 6329889Copy full SHA for 6329889
1 file changed
server/src/lib/migration/migrations/chunithm-lamp-split.ts
@@ -213,8 +213,22 @@ const migration: Migration = {
213
};
214
},
215
async (changes) => {
216
+ const changesPrime = [];
217
+
218
+ for (const change of changes) {
219
+ const scoreExists = await db.scores.findOne({
220
+ scoreID: change.newScore.scoreID,
221
+ });
222
223
+ if (scoreExists) {
224
+ continue;
225
+ }
226
227
+ changesPrime.push(change);
228
229
230
await db.scores.bulkWrite(
- changes.map((c) => ({
231
+ changesPrime.map((c) => ({
232
updateOne: {
233
filter: {
234
scoreID: c.oldScoreID,
0 commit comments