const mongoose = require("mongoose");

const attachmentSchema = new mongoose.Schema({
    message: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'Message',
        required: true,
      },
      fileUrl: {
        type: String,
        required: true,
      },
      fileType: {
        type: String,
        required: true,
      },
      fileName: {
        type: String,
        required: true,
      },
}, {
    timestamps: true,
    collection: 'attachments'
})

module.exports = mongoose.model("Attachment", attachmentSchema);