Skip to content

Commit

Permalink
[HabitRPG#923] also migrate group.websites => group.description (@Fan…
Browse files Browse the repository at this point in the history
…dekasp the

user stuff is solid, thanks!)
  • Loading branch information
lefnire committed Nov 14, 2013
1 parent aad8f80 commit 5038885
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion migrations/20131114_migrate_websites_to_blurb.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
db.users.find({'profile.websites':{$exists: true}}).forEach(function(user){
db.users.update({_id: user._id}, {
$set: {"profile.blurb": user.profile.blurb + '\n * ' + user.profile.websites.join('\n * ')},
$unset: {'profile.websites': ''}
$unset: {'profile.websites': 1}
})
})

db.groups.find({'websites.0':{$exists: true}}).forEach(function(group){
db.groups.update({_id: group._id}, {
$set: {"description": group.description + '\n * ' + group.websites.join('\n * ')},
$unset: {websites: 1}
})
})

0 comments on commit 5038885

Please sign in to comment.