diff --git a/migrations/20130212_preen_cron.js b/migrations/20130212_preen_cron.js index 72261f246a..95b13b0c8a 100644 --- a/migrations/20130212_preen_cron.js +++ b/migrations/20130212_preen_cron.js @@ -1,7 +1,7 @@ /** * Set this up as a midnight cron script * - * mongo habitrpg node_modules/moment/moment.js migrations/json.js migrations/20130212_preen_cron.js + * mongo habitrpg node_modules/moment/moment.js migrations/20130212_preen_cron.js */ diff --git a/migrations/facebook_to_local.js b/migrations/facebook_to_local.js new file mode 100644 index 0000000000..c8238a77fc --- /dev/null +++ b/migrations/facebook_to_local.js @@ -0,0 +1,10 @@ +var oldId = "", + newId = "", + newUser = db.users.findOne({_id: newId}) + +db.users.update({_id: oldId}, {$set:{auth: newUser.auth}}); + +// remove the auth on the new user (which is a template account). The account will be preened automatically later, +// this allows us to keep the account around a few days in case there was a mistake +db.users.update({_id: newId}, {$unset:{auth:1}}); +