Commit
This commit is contained in:
commit
d1c8cae2c1
1417 changed files with 326736 additions and 0 deletions
32
models/Sessions.js
Normal file
32
models/Sessions.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
const {Schema, model} = require('mongoose')
|
||||
|
||||
const MaterialsSchema = new Schema({
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
trim: true
|
||||
},
|
||||
os: {
|
||||
type: String,
|
||||
trim: true
|
||||
}
|
||||
});
|
||||
|
||||
const SessionsSchema = new Schema({
|
||||
user:{
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: 'User',
|
||||
required : true
|
||||
},
|
||||
logDate: {
|
||||
type: Date,
|
||||
required: true
|
||||
},
|
||||
material: MaterialsSchema
|
||||
},{
|
||||
timestamps: true
|
||||
})
|
||||
|
||||
SessionsSchema.index({user:1})
|
||||
|
||||
module.exports = model('Session', SessionsSchema)
|
||||
Loading…
Add table
Add a link
Reference in a new issue