2017-02-08 20:52:37 -05:00
|
|
|
'use strict'
|
2016-10-14 23:31:15 -04:00
|
|
|
|
2017-05-13 15:29:00 -04:00
|
|
|
const Mongoose = require('mongoose')
|
|
|
|
|
2016-10-14 23:31:15 -04:00
|
|
|
/**
|
|
|
|
* Upload File schema
|
|
|
|
*
|
|
|
|
* @type {<Mongoose.Schema>}
|
|
|
|
*/
|
2016-11-20 20:09:50 -05:00
|
|
|
var uplFileSchema = Mongoose.Schema({
|
2016-10-14 23:31:15 -04:00
|
|
|
|
2017-02-08 20:52:37 -05:00
|
|
|
_id: String,
|
2016-10-14 23:31:15 -04:00
|
|
|
|
|
|
|
category: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
default: 'binary'
|
|
|
|
},
|
|
|
|
mime: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
default: 'application/octet-stream'
|
|
|
|
},
|
|
|
|
extra: {
|
|
|
|
type: Object
|
|
|
|
},
|
|
|
|
folder: {
|
|
|
|
type: String,
|
|
|
|
ref: 'UplFolder'
|
|
|
|
},
|
|
|
|
filename: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
basename: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
filesize: {
|
|
|
|
type: Number,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
|
2017-02-08 20:52:37 -05:00
|
|
|
}, { timestamps: {} })
|
2016-10-14 23:31:15 -04:00
|
|
|
|
2017-02-08 20:52:37 -05:00
|
|
|
module.exports = Mongoose.model('UplFile', uplFileSchema)
|