const mongoose = require('mongoose');
mongoose.set('useFindAndModify', false);
const crypto = require("crypto");
//mongoose.set('debug', true)


const schema = new mongoose.Schema({
    created: {
        type: Date,
        default: Date.now,
        index : true
    },
    user: {
        type: mongoose.Types.ObjectId, 
        ref: 'User',
        index : true
    },
    provision: {
        type: mongoose.Types.ObjectId, 
        ref: 'Provision'
    },
    type: {
        type: String
    },
    message: {
        type: String
    }
});


module.exports = mongoose.model('Event', schema)