2018-07-26 19:40:42 -04:00
|
|
|
const mongoose = require('mongoose');
|
|
|
|
|
|
|
|
const KeySchema = mongoose.Schema({
|
|
|
|
key: {
|
|
|
|
type: String,
|
|
|
|
unique: true,
|
|
|
|
required: true
|
|
|
|
},
|
2017-10-18 13:31:08 -04:00
|
|
|
|
|
|
|
identifier: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
2018-07-26 19:40:42 -04:00
|
|
|
|
|
|
|
scope: {
|
|
|
|
type: [String],
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
|
2017-10-18 13:31:08 -04:00
|
|
|
uploadCount: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
2018-07-26 19:40:42 -04:00
|
|
|
|
2017-10-18 13:31:08 -04:00
|
|
|
uploadSize: {
|
|
|
|
type: Number,
|
|
|
|
default: 0
|
|
|
|
},
|
2018-07-26 19:40:42 -04:00
|
|
|
|
|
|
|
issuer: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
|
|
|
|
date: {
|
|
|
|
type: Date,
|
|
|
|
default: Date.now
|
|
|
|
}
|
2017-10-18 13:31:08 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = mongoose.model('Key', KeySchema);
|