mirror of
https://github.com/bodyrep/DemoApp.git
synced 2026-01-25 22:51:37 +00:00
29 lines
567 B
JavaScript
29 lines
567 B
JavaScript
var Schema = require('mongoose').Schema;
|
|
|
|
|
|
var Split = new Schema({
|
|
reps: String,
|
|
weight: String
|
|
});
|
|
|
|
|
|
var Element = new Schema({
|
|
exerciseID: String,
|
|
splits: [Split]
|
|
});
|
|
|
|
|
|
var workoutSchema = new Schema({
|
|
|
|
userID: { type: Schema.ObjectId, ref: 'User', required: true },
|
|
workoutDate: { type: Date, 'default': Date.now },
|
|
workoutTime: { type: Date, 'default': Date.now },
|
|
privacySetting: { type: Number},
|
|
Notes: { type: String},
|
|
templateID: { type: Schema.ObjectId, ref: 'Template'},
|
|
circuits: [Number],
|
|
elements: [Element]
|
|
|
|
});
|
|
|
|
module.exports = workoutSchema; |