v3: define migration spec and misc fixes

This commit is contained in:
Matteo Pagliazzi
2016-04-25 13:51:08 +02:00
parent b6f79aff0b
commit 12b05b9492
7 changed files with 22 additions and 22 deletions

View File

@@ -7,6 +7,10 @@
// It requires two environment variables: MONGODB_OLD and MONGODB_NEW
/*
tags must have a name
*/
console.log('Starting migrations/api_v3/users.js.');
import Q from 'q';
@@ -72,9 +76,10 @@ async function processUser (_id) {
newUser.tasksOrder[`${oldTask.type}s`].push(newTask._id);
// newTask.legacyId = oldTask.id;
let newTaskObject = newTask.toObject();
newTaskObject.legacyId = oldTask.id;
batchInsertTasks.insert(newTask.toObject());
batchInsertTasks.insert(newTaskObject);
});
await Q.all([