Migrations

This commit is contained in:
Stefan Zermatten
2018-11-28 11:48:49 +02:00
parent c7fcb4de0c
commit dcc460d9e6
9 changed files with 84 additions and 83 deletions

View File

@@ -1,4 +1,5 @@
import SimpleSchema from 'simpl-schema';
import {makeChild} from "/imports/api/parenting.js";
let Actions = new Mongo.Collection("actions");
@@ -28,17 +29,17 @@ let actionSchema = new SimpleSchema({
},
//the immediate impact of doing this action (eg. -1 rages)
adjustments: {
type: [Schemas.Adjustment],
type: Array,
defaultValue: [],
},
"adjustments.$": {
type: Object,
},
});
Actions.attachSchema(actionSchema);
Actions.attachBehaviour("softRemovable");
// Actions.attachBehaviour("softRemovable");
makeChild(Actions);
Actions.allow(CHARACTER_SUBSCHEMA_ALLOW);
Actions.deny(CHARACTER_SUBSCHEMA_DENY);
export default Actions

View File

@@ -20,6 +20,9 @@ conditionSchema = new SimpleSchema({
optional: true,
trim: false,
},
lifeTime: {
type: Object,
},
"lifeTime.total": {
type: Number,
defaultValue: 0, //0 is infinite

View File

@@ -33,10 +33,10 @@ let creatureSchema = new SimpleSchema({
//permissions
party: {type: String, regEx: SimpleSchema.RegEx.Id, optional: true},
owner: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
readers: {type: Array, defaultValue: []},
"readers.$": {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
writers: {type: Array, defaultValue: []},
"writers.$": {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
readers: {type: Array, defaultValue: [], index: 1},
"readers.$": {type: String, regEx: SimpleSchema.RegEx.Id},
writers: {type: Array, defaultValue: [], index: 1},
"writers.$": {type: String, regEx: SimpleSchema.RegEx.Id},
settings: {type: Object},
//how many experiences to load at a time in XP table
"settings.experiencesInc": {type: SimpleSchema.Integer, defaultValue: 20},

View File

@@ -1,4 +1,5 @@
import SimpleSchema from 'simpl-schema';
import {makeChild} from "/imports/api/parenting.js";
DamageMultipliers = new Mongo.Collection("damageMultipliers");
@@ -31,8 +32,5 @@ Schemas.DamageMultiplier = new SimpleSchema({
DamageMultipliers.attachSchema(Schemas.DamageMultiplier);
DamageMultipliers.attachBehaviour("softRemovable");
// DamageMultipliers.attachBehaviour("softRemovable");
makeChild(DamageMultipliers, ["enabled"]); //children of lots of things
DamageMultipliers.allow(CHARACTER_SUBSCHEMA_ALLOW);
DamageMultipliers.deny(CHARACTER_SUBSCHEMA_DENY);

View File

@@ -5,8 +5,10 @@ Libraries = new Mongo.Collection("library");
librarySchema = new SimpleSchema({
name: {type: String},
owner: {type: String, regEx: SimpleSchema.RegEx.Id},
readers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: []},
writers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: []},
readers: {type: Array, defaultValue: []},
"readers.$": {type: String, regEx: SimpleSchema.RegEx.Id},
writers: {type: Array, defaultValue: []},
"writers.$": {type: String, regEx: SimpleSchema.RegEx.Id},
public: {type: Boolean, defaultValue: false},
});

View File

@@ -46,8 +46,10 @@ Schemas.LibrarySpells = new SimpleSchema({
allowedValues: magicSchools,
},
library: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
effects: {type: [Schemas.LibraryEffects], defaultValue: []},
attacks: {type: [Schemas.LibraryAttacks], defaultValue: []},
effects: {type: Array},
"effects.$": {type: Schemas.LibraryEffects, defaultValue: []},
attacks: {type: Array},
"attacks.$": {type: Schemas.LibraryAttacks, defaultValue: []},
});
LibrarySpells.attachSchema(Schemas.LibrarySpells);