From 314da14ad139c880cade8e2da9bc0f0b43499c8f Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Mon, 2 Nov 2015 09:35:05 +0200 Subject: [PATCH] Added indexes to charId on character fields --- rpg-docs/Model/Character/Actions.js | 1 + rpg-docs/Model/Character/Attacks.js | 1 + rpg-docs/Model/Character/Buffs.js | 1 + rpg-docs/Model/Character/Classes.js | 2 +- rpg-docs/Model/Character/Effects.js | 1 + rpg-docs/Model/Character/Experience.js | 2 +- rpg-docs/Model/Character/Features.js | 2 +- rpg-docs/Model/Character/Notes.js | 2 +- rpg-docs/Model/Character/Proficiencies.js | 1 + rpg-docs/Model/Character/SpellLists.js | 2 +- rpg-docs/Model/Character/Spells.js | 2 +- rpg-docs/Model/Character/TemporaryHitPoints.js | 2 +- rpg-docs/Model/Inventory/Containers.js | 2 +- rpg-docs/Model/Inventory/Items.js | 2 +- 14 files changed, 14 insertions(+), 9 deletions(-) diff --git a/rpg-docs/Model/Character/Actions.js b/rpg-docs/Model/Character/Actions.js index b3224009..a4e2e236 100644 --- a/rpg-docs/Model/Character/Actions.js +++ b/rpg-docs/Model/Character/Actions.js @@ -7,6 +7,7 @@ Schemas.Action = new SimpleSchema({ charId: { type: String, regEx: SimpleSchema.RegEx.Id, + index: 1, }, name: { type: String, diff --git a/rpg-docs/Model/Character/Attacks.js b/rpg-docs/Model/Character/Attacks.js index 9b00c6bf..2450439a 100644 --- a/rpg-docs/Model/Character/Attacks.js +++ b/rpg-docs/Model/Character/Attacks.js @@ -7,6 +7,7 @@ Schemas.Attack = new SimpleSchema({ charId: { type: String, regEx: SimpleSchema.RegEx.Id, + index: 1, }, name: { type: String, diff --git a/rpg-docs/Model/Character/Buffs.js b/rpg-docs/Model/Character/Buffs.js index 61d471b1..3d8c41c5 100644 --- a/rpg-docs/Model/Character/Buffs.js +++ b/rpg-docs/Model/Character/Buffs.js @@ -4,6 +4,7 @@ Schemas.Buff = new SimpleSchema({ charId: { type: String, regEx: SimpleSchema.RegEx.Id, + index: 1, }, name: { type: String, diff --git a/rpg-docs/Model/Character/Classes.js b/rpg-docs/Model/Character/Classes.js index cd42a99e..ac036230 100644 --- a/rpg-docs/Model/Character/Classes.js +++ b/rpg-docs/Model/Character/Classes.js @@ -1,7 +1,7 @@ Classes = new Mongo.Collection("classes"); Schemas.Class = new SimpleSchema({ - charId: {type: String, regEx: SimpleSchema.RegEx.Id}, + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, name: {type: String, trim: false}, level: {type: Number}, createdAt: { diff --git a/rpg-docs/Model/Character/Effects.js b/rpg-docs/Model/Character/Effects.js index 6a6edeff..44cc8036 100644 --- a/rpg-docs/Model/Character/Effects.js +++ b/rpg-docs/Model/Character/Effects.js @@ -8,6 +8,7 @@ Schemas.Effect = new SimpleSchema({ charId: { type: String, regEx: SimpleSchema.RegEx.Id, + index: 1, }, name: { type: String, diff --git a/rpg-docs/Model/Character/Experience.js b/rpg-docs/Model/Character/Experience.js index ee3c1d3e..ff6d5932 100644 --- a/rpg-docs/Model/Character/Experience.js +++ b/rpg-docs/Model/Character/Experience.js @@ -1,7 +1,7 @@ Experiences = new Mongo.Collection("experience"); Schemas.Experience = new SimpleSchema({ - charId: {type: String, regEx: SimpleSchema.RegEx.Id}, + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, name: {type: String, defaultValue: "New Experience", trim: false}, description: {type: String, optional: true, trim: false}, value: {type: Number, defaultValue: 0}, diff --git a/rpg-docs/Model/Character/Features.js b/rpg-docs/Model/Character/Features.js index 29568563..24a2b5e9 100644 --- a/rpg-docs/Model/Character/Features.js +++ b/rpg-docs/Model/Character/Features.js @@ -1,7 +1,7 @@ Features = new Mongo.Collection("features"); Schemas.Feature = new SimpleSchema({ - charId: {type: String, regEx: SimpleSchema.RegEx.Id}, + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, name: {type: String, trim: false}, description: {type: String, optional: true, trim: false}, uses: {type: String, optional: true, trim: false}, diff --git a/rpg-docs/Model/Character/Notes.js b/rpg-docs/Model/Character/Notes.js index 48fb509e..8d1afdf5 100644 --- a/rpg-docs/Model/Character/Notes.js +++ b/rpg-docs/Model/Character/Notes.js @@ -1,7 +1,7 @@ Notes = new Mongo.Collection("notes"); Schemas.Note = new SimpleSchema({ - charId: {type: String, regEx: SimpleSchema.RegEx.Id}, + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, name: {type: String, trim: false}, description: {type: String, optional: true, trim: false}, color: { diff --git a/rpg-docs/Model/Character/Proficiencies.js b/rpg-docs/Model/Character/Proficiencies.js index 2d8001e2..22c6851f 100644 --- a/rpg-docs/Model/Character/Proficiencies.js +++ b/rpg-docs/Model/Character/Proficiencies.js @@ -4,6 +4,7 @@ Schemas.Proficiency = new SimpleSchema({ charId: { type: String, regEx: SimpleSchema.RegEx.Id, + index: 1, }, name: { type: String, diff --git a/rpg-docs/Model/Character/SpellLists.js b/rpg-docs/Model/Character/SpellLists.js index 4624365b..16aa2dab 100644 --- a/rpg-docs/Model/Character/SpellLists.js +++ b/rpg-docs/Model/Character/SpellLists.js @@ -1,7 +1,7 @@ SpellLists = new Mongo.Collection("spellLists"); Schemas.SpellLists = new SimpleSchema({ - charId: {type: String, regEx: SimpleSchema.RegEx.Id}, + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, name: {type: String, trim: false}, description: {type: String, optional: true, trim: false}, saveDC: {type: String, optional: true, trim: false}, diff --git a/rpg-docs/Model/Character/Spells.js b/rpg-docs/Model/Character/Spells.js index 43e5e388..f04e2fa7 100644 --- a/rpg-docs/Model/Character/Spells.js +++ b/rpg-docs/Model/Character/Spells.js @@ -1,7 +1,7 @@ Spells = new Mongo.Collection("spells"); Schemas.Spell = new SimpleSchema({ - charId: {type: String, regEx: SimpleSchema.RegEx.Id}, + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, prepared: { type: String, defaultValue: "prepared", diff --git a/rpg-docs/Model/Character/TemporaryHitPoints.js b/rpg-docs/Model/Character/TemporaryHitPoints.js index 5f47f0b2..65b2a44b 100644 --- a/rpg-docs/Model/Character/TemporaryHitPoints.js +++ b/rpg-docs/Model/Character/TemporaryHitPoints.js @@ -1,7 +1,7 @@ TemporaryHitPoints = new Mongo.Collection("temporaryHitPoints"); Schemas.TemporaryHitPoints = new SimpleSchema({ - charId: {type: String, regEx: SimpleSchema.RegEx.Id}, + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, name: {type: String, optional: true}, maximum: {type: Number, defaultValue: 0, min: 0, max: 500}, used: {type: Number, defaultValue: 0, min: 0, max: 500}, diff --git a/rpg-docs/Model/Inventory/Containers.js b/rpg-docs/Model/Inventory/Containers.js index 8ee69416..94761c58 100644 --- a/rpg-docs/Model/Inventory/Containers.js +++ b/rpg-docs/Model/Inventory/Containers.js @@ -3,7 +3,7 @@ Containers = new Mongo.Collection("containers"); Schemas.Container = new SimpleSchema({ name: {type: String, trim: false}, - charId: {type: String, regEx: SimpleSchema.RegEx.Id}, + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, isCarried: {type: Boolean}, weight: {type: Number, min: 0, defaultValue: 0, decimal: true}, value: {type: Number, min: 0, defaultValue: 0, decimal: true}, diff --git a/rpg-docs/Model/Inventory/Items.js b/rpg-docs/Model/Inventory/Items.js index 872d4eb0..c3a590a9 100644 --- a/rpg-docs/Model/Inventory/Items.js +++ b/rpg-docs/Model/Inventory/Items.js @@ -4,7 +4,7 @@ Schemas.Item = new SimpleSchema({ name: {type: String, defaultValue: "New Item", trim: false}, plural: {type: String, optional: true, trim: false}, description:{type: String, optional: true, trim: false}, - charId: {type: String, regEx: SimpleSchema.RegEx.Id}, //id of owner + charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1}, //id of owner quantity: {type: Number, min: 0, defaultValue: 1}, weight: {type: Number, min: 0, defaultValue: 0, decimal: true}, value: {type: Number, min: 0, defaultValue: 0, decimal: true},