v3 migration: correctly migrate challenges tasks

This commit is contained in:
Matteo Pagliazzi
2016-05-03 23:27:24 +02:00
parent c218a2cbdf
commit e5e4bb5823
4 changed files with 58 additions and 5 deletions

View File

@@ -86,6 +86,13 @@ function processChallenges (afterId) {
lastChallenge = oldChallenges[oldChallenges.length - 1]._id;
}
// Tyler Renelle
oldChallenge.members.forEach(function (id, index) {
if (id === '9') {
oldChallenge.members[index] = '00000000-0000-4000-9000-000000000000';
}
});
oldChallenges.forEach(function (oldChallenge) {
promises.push(newUserCollection.updateMany({
_id: {$in: oldChallenge.members},