More migrations...
This commit is contained in:
@@ -10,10 +10,13 @@ let partySchema = new SimpleSchema({
|
|||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
characters: {
|
characters: {
|
||||||
type: [String],
|
type: Array,
|
||||||
|
defaultValue: [],
|
||||||
|
},
|
||||||
|
characters: {
|
||||||
|
type: String,
|
||||||
regEx: SimpleSchema.RegEx.Id,
|
regEx: SimpleSchema.RegEx.Id,
|
||||||
index: 1,
|
index: 1,
|
||||||
defaultValue: [],
|
|
||||||
},
|
},
|
||||||
owner: {
|
owner: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|||||||
@@ -72,3 +72,5 @@ getDefaultCreatureDocs = function(charId, creatureType = "pc"){
|
|||||||
}
|
}
|
||||||
return docs;
|
return docs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default getDefaultCreatureDocs;
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { ValidatedMethod } from 'meteor/mdg:validated-method';
|
import { ValidatedMethod } from 'meteor/mdg:validated-method';
|
||||||
import SimpleSchema from 'simpl-schema';
|
import SimpleSchema from 'simpl-schema';
|
||||||
import Effects from "/imports/api/creature/Effects.js"
|
import Effects from "/imports/api/creature/Effects.js"
|
||||||
import deathSaveSchema from "/imports/api/creature/subSchemas/DeathSaves.js"
|
import deathSaveSchema from "/imports/api/creature/subSchemas/DeathSavesSchema.js"
|
||||||
import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js";
|
import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js";
|
||||||
|
import getDefaultCreatureDocs from "/imports/api/creature/CreatureDefaults.js";
|
||||||
|
|
||||||
//set up the collection for creatures
|
//set up the collection for creatures
|
||||||
Creatures = new Mongo.Collection("creatures");
|
Creatures = new Mongo.Collection("creatures");
|
||||||
@@ -32,9 +33,11 @@ let creatureSchema = new SimpleSchema({
|
|||||||
//permissions
|
//permissions
|
||||||
party: {type: String, regEx: SimpleSchema.RegEx.Id, optional: true},
|
party: {type: String, regEx: SimpleSchema.RegEx.Id, optional: true},
|
||||||
owner: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
owner: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||||
readers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: [], index: 1},
|
readers: {type: Array, defaultValue: []},
|
||||||
writers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: [], index: 1},
|
"readers.$": {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||||
//TODO add per-creature settings
|
writers: {type: Array, defaultValue: []},
|
||||||
|
"writers.$": {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||||
|
settings: {type: Object},
|
||||||
//how many experiences to load at a time in XP table
|
//how many experiences to load at a time in XP table
|
||||||
"settings.experiencesInc": {type: SimpleSchema.Integer, defaultValue: 20},
|
"settings.experiencesInc": {type: SimpleSchema.Integer, defaultValue: 20},
|
||||||
//slowed down by carrying too much?
|
//slowed down by carrying too much?
|
||||||
@@ -144,7 +147,7 @@ if (Meteor.isServer){
|
|||||||
});
|
});
|
||||||
|
|
||||||
//give characters default items
|
//give characters default items
|
||||||
Characters.after.insert(function(userId, char) {
|
Creatures.after.insert(function(userId, char) {
|
||||||
if (Meteor.isServer){
|
if (Meteor.isServer){
|
||||||
var containerId = Containers.insert({
|
var containerId = Containers.insert({
|
||||||
name: "Coin Pouch",
|
name: "Coin Pouch",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
import SimpleSchema from 'simpl-schema';
|
||||||
|
|
||||||
Libraries = new Mongo.Collection("library");
|
Libraries = new Mongo.Collection("library");
|
||||||
|
|
||||||
Schemas.Library = new SimpleSchema({
|
librarySchema = new SimpleSchema({
|
||||||
name: {type: String},
|
name: {type: String},
|
||||||
owner: {type: String, regEx: SimpleSchema.RegEx.Id},
|
owner: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||||
readers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: []},
|
readers: {type: [String], regEx: SimpleSchema.RegEx.Id, defaultValue: []},
|
||||||
@@ -8,7 +10,7 @@ Schemas.Library = new SimpleSchema({
|
|||||||
public: {type: Boolean, defaultValue: false},
|
public: {type: Boolean, defaultValue: false},
|
||||||
});
|
});
|
||||||
|
|
||||||
Libraries.attachSchema(Schemas.Library);
|
Libraries.attachSchema(librarySchema);
|
||||||
|
|
||||||
Libraries.allow({
|
Libraries.allow({
|
||||||
insert(userId, doc) {
|
insert(userId, doc) {
|
||||||
@@ -45,3 +47,5 @@ Libraries.canEdit = function(userId, libraryId){
|
|||||||
const library = Libraries.findOne(libraryId);
|
const library = Libraries.findOne(libraryId);
|
||||||
return canEdit(userId, library);
|
return canEdit(userId, library);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Libraries;
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
import SimpleSchema from 'simpl-schema';
|
||||||
|
import libraryAttacksSchema from "/imports/api/library/";
|
||||||
|
|
||||||
LibraryItems = new Mongo.Collection("libraryItems");
|
LibraryItems = new Mongo.Collection("libraryItems");
|
||||||
|
|
||||||
Schemas.LibraryItems = new SimpleSchema({
|
libraryItemsSchema = new SimpleSchema({
|
||||||
libraryName:{type: String, optional: true, trim: false},
|
libraryName:{type: String, optional: true, trim: false},
|
||||||
name: {type: String, defaultValue: "New Item", trim: false},
|
name: {type: String, defaultValue: "New Item", trim: false},
|
||||||
plural: {type: String, optional: true, trim: false},
|
plural: {type: String, optional: true, trim: false},
|
||||||
@@ -12,6 +15,7 @@ Schemas.LibraryItems = new SimpleSchema({
|
|||||||
|
|
||||||
library: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
library: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
|
||||||
|
|
||||||
|
settings: {type: Object},
|
||||||
"settings.category": {
|
"settings.category": {
|
||||||
type: String,
|
type: String,
|
||||||
optional: true,
|
optional: true,
|
||||||
@@ -24,11 +28,11 @@ Schemas.LibraryItems = new SimpleSchema({
|
|||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
effects: {type: [Schemas.LibraryEffects], defaultValue: []},
|
effects: [Schemas.LibraryEffects],
|
||||||
attacks: {type: [Schemas.LibraryAttacks], defaultValue: []},
|
attacks: [Schemas.LibraryAttacks],
|
||||||
});
|
});
|
||||||
|
|
||||||
LibraryItems.attachSchema(Schemas.LibraryItems);
|
LibraryItems.attachSchema(libraryItemsSchema);
|
||||||
|
|
||||||
LibraryItems.allow({
|
LibraryItems.allow({
|
||||||
insert(userId, doc) {
|
insert(userId, doc) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "characterList.js";
|
import "./characterList.js";
|
||||||
import "library.js";
|
import "./library.js";
|
||||||
import "singleCharacter.js";
|
import "./singleCharacter.js";
|
||||||
import "user.js";
|
import "./user.js";
|
||||||
import "users.js";
|
import "./users.js";
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import Libraries from "/imports/api/library/library.js"
|
import Libraries from "/imports/api/library/Library.js"
|
||||||
|
|
||||||
const standardLibraryIds = [
|
const standardLibraryIds = [
|
||||||
"SRDLibraryGA3XWsd",
|
"SRDLibraryGA3XWsd",
|
||||||
|
|||||||
Reference in New Issue
Block a user