mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 13:17:24 +01:00
tags: add migration to set initial empty tags to an array - why was it
being set to an object?
This commit is contained in:
12
migrations/20130507_fix_broken_tags.js
Normal file
12
migrations/20130507_fix_broken_tags.js
Normal 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
1
migrations/new_stuff.js
Normal file
@@ -0,0 +1 @@
|
||||
db.users.update({},{$set:{'flags.newStuff':'show'}},{multi:true})
|
||||
Reference in New Issue
Block a user