Added migration to add TempHP to all characters

This commit is contained in:
Jacob
2017-07-29 22:41:37 +01:00
parent 2ca13fbb56
commit 826859ca3f

View File

@@ -36,3 +36,21 @@ Migrations.add({
return;
},
});
Migrations.add({
version: 2,
name: "Adds TempHP as a character attribute",
up: function() {
//update characters
Characters.find({}).forEach(function(char){
if (char.tempHP) return;
Characters.update(char._id, {$set: {
"tempHP.adjustment": 0,
"tempHP.reset": "longRest",
}});
});
},
down: function(){
return;
},
});