2017-04-07 01:29:05 +02:00
|
|
|
'use strict';
|
|
|
|
|
2018-04-12 18:40:58 +02:00
|
|
|
// FIXME port this last model
|
|
|
|
|
2017-04-07 01:29:05 +02:00
|
|
|
var mongoose = require('mongoose');
|
|
|
|
var Schema = mongoose.Schema;
|
|
|
|
|
|
|
|
module.exports.actionSchema = mongoose.Schema({
|
|
|
|
space: {
|
|
|
|
type: Schema.Types.ObjectId,
|
|
|
|
ref: 'Space'
|
|
|
|
},
|
|
|
|
user: {
|
|
|
|
type: Schema.Types.ObjectId,
|
|
|
|
ref: 'User'
|
|
|
|
},
|
|
|
|
editor_name: String,
|
|
|
|
action: String,
|
|
|
|
object: Schema.Types.Mixed,
|
|
|
|
created_at: {
|
|
|
|
type: Date,
|
|
|
|
default: Date.now
|
|
|
|
},
|
|
|
|
updated_at: {
|
|
|
|
type: Date,
|
|
|
|
default: Date.now
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports.actionSchema.index({
|
|
|
|
space: 1,
|
|
|
|
created_at: 1
|
|
|
|
});
|
|
|
|
|