Made names optional for all collections

closes #92
This commit is contained in:
Stefan Zermatten
2017-07-13 10:39:43 +02:00
parent 1e67afbe6f
commit 99c72d1e10
11 changed files with 12 additions and 7 deletions

View File

@@ -11,10 +11,12 @@ Schemas.Action = new SimpleSchema({
}, },
name: { name: {
type: String, type: String,
optional: true,
trim: false, trim: false,
}, },
description: { description: {
type: String, type: String,
optional: true,
trim: false, trim: false,
}, },
type: { type: {

View File

@@ -12,6 +12,7 @@ Schemas.Attack = new SimpleSchema({
name: { name: {
type: String, type: String,
defaultValue: "New Attack", defaultValue: "New Attack",
optional: true,
trim: false, trim: false,
}, },
details: { details: {

View File

@@ -8,6 +8,7 @@ Schemas.Buff = new SimpleSchema({
}, },
name: { name: {
type: String, type: String,
optional: true,
trim: false, trim: false,
}, },
description: { description: {

View File

@@ -2,7 +2,7 @@ Classes = new Mongo.Collection("classes");
Schemas.Class = new SimpleSchema({ Schemas.Class = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
name: {type: String, trim: false}, name: {type: String, optional: true, trim: false},
level: {type: Number}, level: {type: Number},
createdAt: { createdAt: {
type: Date, type: Date,

View File

@@ -2,7 +2,7 @@ Experiences = new Mongo.Collection("experience");
Schemas.Experience = new SimpleSchema({ Schemas.Experience = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
name: {type: String, defaultValue: "New Experience", trim: false}, name: {type: String, optional: true, trim: false, defaultValue: "New Experience"},
description: {type: String, optional: true, trim: false}, description: {type: String, optional: true, trim: false},
value: {type: Number, defaultValue: 0}, value: {type: Number, defaultValue: 0},
dateAdded: { dateAdded: {

View File

@@ -2,7 +2,7 @@ Features = new Mongo.Collection("features");
Schemas.Feature = new SimpleSchema({ Schemas.Feature = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
name: {type: String, trim: false}, name: {type: String, optional: true, trim: false},
description: {type: String, optional: true, trim: false}, description: {type: String, optional: true, trim: false},
uses: {type: String, optional: true, trim: false}, uses: {type: String, optional: true, trim: false},
used: {type: Number, defaultValue: 0}, used: {type: Number, defaultValue: 0},

View File

@@ -2,7 +2,7 @@ Notes = new Mongo.Collection("notes");
Schemas.Note = new SimpleSchema({ Schemas.Note = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
name: {type: String, trim: false}, name: {type: String, optional: true, trim: false},
description: {type: String, optional: true, trim: false}, description: {type: String, optional: true, trim: false},
color: { color: {
type: String, type: String,

View File

@@ -2,7 +2,7 @@ SpellLists = new Mongo.Collection("spellLists");
Schemas.SpellLists = new SimpleSchema({ Schemas.SpellLists = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
name: {type: String, trim: false}, name: {type: String, optional: true, trim: false},
description: {type: String, optional: true, trim: false}, description: {type: String, optional: true, trim: false},
saveDC: {type: String, optional: true, trim: false}, saveDC: {type: String, optional: true, trim: false},
attackBonus: {type: String, optional: true, trim: false}, attackBonus: {type: String, optional: true, trim: false},

View File

@@ -9,6 +9,7 @@ Schemas.Spell = new SimpleSchema({
}, },
name: { name: {
type: String, type: String,
optional: true,
trim: false, trim: false,
defaultValue: "New Spell", defaultValue: "New Spell",
}, },

View File

@@ -2,7 +2,7 @@
Containers = new Mongo.Collection("containers"); Containers = new Mongo.Collection("containers");
Schemas.Container = new SimpleSchema({ Schemas.Container = new SimpleSchema({
name: {type: String, trim: false}, name: {type: String, optional: true, trim: false},
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
isCarried: {type: Boolean}, isCarried: {type: Boolean},
weight: {type: Number, min: 0, defaultValue: 0, decimal: true}, weight: {type: Number, min: 0, defaultValue: 0, decimal: true},

View File

@@ -1,7 +1,7 @@
Items = new Mongo.Collection("items"); Items = new Mongo.Collection("items");
Schemas.Item = new SimpleSchema({ Schemas.Item = new SimpleSchema({
name: {type: String, defaultValue: "New Item", trim: false}, name: {type: String, optional: true, trim: false, defaultValue: "New Item"},
plural: {type: String, optional: true, trim: false}, plural: {type: String, optional: true, trim: false},
description:{type: String, optional: true, trim: false}, description:{type: String, optional: true, trim: false},
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, //id of owner charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, //id of owner