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

@@ -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);