You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
648 B

  1. 'use strict'
  2. /**
  3. * Upload File schema
  4. *
  5. * @type {<Mongoose.Schema>}
  6. */
  7. var uplFileSchema = Mongoose.Schema({
  8. _id: String,
  9. category: {
  10. type: String,
  11. required: true,
  12. default: 'binary'
  13. },
  14. mime: {
  15. type: String,
  16. required: true,
  17. default: 'application/octet-stream'
  18. },
  19. extra: {
  20. type: Object
  21. },
  22. folder: {
  23. type: String,
  24. ref: 'UplFolder'
  25. },
  26. filename: {
  27. type: String,
  28. required: true
  29. },
  30. basename: {
  31. type: String,
  32. required: true
  33. },
  34. filesize: {
  35. type: Number,
  36. required: true
  37. }
  38. }, { timestamps: {} })
  39. module.exports = Mongoose.model('UplFile', uplFileSchema)