2013-12-05 00:08:55 +00:00
|
|
|
/**
|
|
|
|
|
* Probably the biggest migration of all! This adds the following features:
|
|
|
|
|
* - Customization Redo: https://trello.com/c/YKXmHNjY/306-customization-redo
|
|
|
|
|
* - Armory: https://trello.com/c/83M5RqQB/299-armory
|
|
|
|
|
* - Classes
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
db.users.find().forEach(function(user){
|
|
|
|
|
|
2013-12-05 22:48:50 +00:00
|
|
|
user.stats.class = 'warrior';
|
|
|
|
|
|
2013-12-14 04:53:42 +00:00
|
|
|
// set default stats (inc mp?)
|
|
|
|
|
user.stats.points = user.stats.lvl;
|
2013-12-10 15:55:04 +00:00
|
|
|
|
2013-12-06 01:20:09 +00:00
|
|
|
// grant backer/contrib gear, 300, rather than using js logic
|
2013-12-05 00:08:55 +00:00
|
|
|
|
2013-12-07 18:31:11 +00:00
|
|
|
// customizations redo: https://trello.com/c/YKXmHNjY/306-customization-redo
|
|
|
|
|
|
2013-12-05 00:08:55 +00:00
|
|
|
// migrate current owned items
|
|
|
|
|
|
|
|
|
|
// gender => size
|
|
|
|
|
user.preferences.size = (user.preferences.gender == 'f') ? 'slim' : 'broad';
|
|
|
|
|
delete user.preferences.gender;
|
|
|
|
|
|
|
|
|
|
// Delete armorSet
|
|
|
|
|
delete user.preferences.armorSet;
|
|
|
|
|
|
2013-12-13 03:23:25 +00:00
|
|
|
user.preferences.sleep = user.flags.rest;
|
|
|
|
|
delete user.flags.rest;
|
|
|
|
|
|
2013-12-13 03:39:47 +00:00
|
|
|
_.each(user.tasks, function(task){
|
2013-12-14 04:53:42 +00:00
|
|
|
|
|
|
|
|
// migrate task.priority from !, !!, !!! => 1, 1.5, 2
|
2013-12-13 03:39:47 +00:00
|
|
|
var p = task.priority;
|
|
|
|
|
task.priority = p == '!!!' ? 2 : p == '!!' ? 1.5 : 1;
|
2013-12-14 04:53:42 +00:00
|
|
|
|
|
|
|
|
// Add task attributes
|
|
|
|
|
task.attribute = 'str';
|
|
|
|
|
|
2013-12-13 03:39:47 +00:00
|
|
|
})
|
|
|
|
|
|
2013-12-05 00:08:55 +00:00
|
|
|
db.users.update({_id:user._id}, user);
|
|
|
|
|
});
|