mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00: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:
parent
7e6fe850e8
commit
59f9b742d9
2 changed files with 13 additions and 0 deletions
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})
|
||||
Loading…
Reference in a new issue