tags: add migration to set initial empty tags to an array - why was it

being set to an object?
This commit is contained in:
Tyler Renelle
2013-05-07 10:27:31 +01:00
parent 7e6fe850e8
commit 59f9b742d9
2 changed files with 13 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
/**
* users getting broken tags when they try to edit the first blank tag on accident
*
* mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130507_fix_broken_tags.js
*/
db.users.find().forEach(function(user){
if(!_.isArray(user.tags)) {
db.users.update({_id:user._id}, {$set:{tags:[]}});
}
})

1
migrations/new_stuff.js Normal file
View File

@@ -0,0 +1 @@
db.users.update({},{$set:{'flags.newStuff':'show'}},{multi:true})