action.js 553 B

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict';
  2. // FIXME port this last model
  3. var mongoose = require('mongoose');
  4. var Schema = mongoose.Schema;
  5. module.exports.actionSchema = mongoose.Schema({
  6. space: {
  7. type: Schema.Types.ObjectId,
  8. ref: 'Space'
  9. },
  10. user: {
  11. type: Schema.Types.ObjectId,
  12. ref: 'User'
  13. },
  14. editor_name: String,
  15. action: String,
  16. object: Schema.Types.Mixed,
  17. created_at: {
  18. type: Date,
  19. default: Date.now
  20. },
  21. updated_at: {
  22. type: Date,
  23. default: Date.now
  24. }
  25. });
  26. module.exports.actionSchema.index({
  27. space: 1,
  28. created_at: 1
  29. });