From 17106ad3e7d9dae613b55981d712e93569a1faa8 Mon Sep 17 00:00:00 2001 From: Kenneth Jao Date: Sun, 7 Aug 2016 15:03:24 -0400 Subject: [PATCH] Added schemas for collections --- hourglass/.meteor/packages | 1 + hourglass/.meteor/versions | 2 ++ hourglass/server/main.js | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/hourglass/.meteor/packages b/hourglass/.meteor/packages index 3825d99..9e5042b 100644 --- a/hourglass/.meteor/packages +++ b/hourglass/.meteor/packages @@ -22,3 +22,4 @@ insecure@1.0.7 # Allow all DB writes from clients (for prototypin fortawesome:fontawesome session proyk:meteor-cookies +aldeed:simple-schema diff --git a/hourglass/.meteor/versions b/hourglass/.meteor/versions index 69248bc..bde488b 100644 --- a/hourglass/.meteor/versions +++ b/hourglass/.meteor/versions @@ -1,3 +1,4 @@ +aldeed:simple-schema@1.5.3 allow-deny@1.0.5 autopublish@1.0.7 autoupdate@1.2.11 @@ -36,6 +37,7 @@ jquery@1.11.9 launch-screen@1.0.12 livedata@1.0.18 logging@1.1.14 +mdg:validation-error@0.2.0 meteor@1.2.16 meteor-base@1.0.4 minifier-css@1.2.13 diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 6439838..c54a701 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -1,6 +1,42 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; +schools = new Mongo.Collection("Schools"); +classes = new Mongo.Collection("Classes"); +homework = new Mongo.Collection("Homework"); + +schools.schema = new SimpleSchema({ + name: {type: String}, + aliases: {type: [String]} +}); + +classes.schema = new SimpleSchema({ + school: {type: String}, + //icon: {type: String}, + hour: {type: String}, + teacher: {type: String}, + name: {type: String, label: "Class Name"}, + status: {type: boolean, defaultValue: false}, + code: {type: String, optional: true}, + privacy: {type: String}, + category: {type: String}, + /*moderators: {type: [String]}, + banned: {type: [String]}, + blockEdit: {type: [String]}, + admin: {type: String}*/ +}); + +homework.schema = new SimpleSchema({ + class: {type: String}, + dueDate: {type: Date}, + aliases: {type: [String]}, + submittor: {type: String}, + confirmations: {type: [String]}, + reports: {type: [String], optional: true}, + attachments: {type: [String], optional: true}, + done: {type: [String], optional: true} +}); + Meteor.startup(() => { Meteor.methods({