add migration script for moving facebook auth'd users to local

auth (seems people hate facebook)
This commit is contained in:
Tyler Renelle
2013-06-14 15:56:27 -04:00
parent dfff22c52b
commit 6ab64e2df1
2 changed files with 11 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
/** /**
* Set this up as a midnight cron script * 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
*/ */

View File

@@ -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}});