File.js 448 B

123456789101112131415161718192021222324
  1. const mongoose = require('../infrastructure/Mongoose')
  2. const { Schema } = mongoose
  3. const FileSchema = new Schema({
  4. name: {
  5. type: String,
  6. default: ''
  7. },
  8. created: {
  9. type: Date,
  10. default() {
  11. return new Date()
  12. }
  13. },
  14. rev: { type: Number, default: 0 },
  15. linkedFileData: { type: Schema.Types.Mixed },
  16. hash: {
  17. type: String
  18. }
  19. })
  20. exports.File = mongoose.model('File', FileSchema)
  21. exports.FileSchema = FileSchema