You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
560 B
JavaScript
19 lines
560 B
JavaScript
4 years ago
|
var mongoose = require('mongoose');
|
||
|
var Schema = mongoose.Schema;
|
||
|
|
||
|
var MediaSchema = new Schema({
|
||
|
name: {type: String, required: true},
|
||
|
urlslug: {type: String, required: true, unique: true},
|
||
|
uploaded: {type: Number, required: true},
|
||
|
filename: {type: String, required: true, unique: true},
|
||
|
thumbnail: {type: String},
|
||
|
mimetype: {type: String, required: true},
|
||
|
width: {type:Number,required:true},
|
||
|
height: {type:Number,required:true}
|
||
|
});
|
||
|
|
||
|
var Media = mongoose.model('Media', MediaSchema);
|
||
|
|
||
|
module.exports.model = Media;
|
||
|
module.exports.schema = MediaSchema
|