Database Schema - pgwest/LDSCallings GitHub Wiki

Database Schema:

**Everything in the database is stored based on the following three Schemas. All three are stored using mongoose into mongodb. **

Users

The User schema looks like { name, username, pasword_hash, ward: wardId: calling: email: resetPasswordToken: resetPasswordExpires: }

Or in the code as:

var userSchema = new Schema({
name: String,
username: {type: String, index: true, unique: true},
password_hash: String,
ward: String,
wardId: Number,
calling: String,
email: {type: String, required:true, unique: true},
resetPasswordToken : String,
resetPasswordExpires: Date,
});

Tables

The Table schema looks like
{ user, id, key, title: tableData: }

or in code as

var tableSchema = new Schema({
user: {type: ObjectId, ref: 'users'},
id: Number,
key: Number,
title: String,
tableData: [],
});

Groups

Yet to come, not currently implemented

When Group ID's added, User and Table will be updated.