diff --git a/models/Media.js b/models/Media.js new file mode 100644 index 0000000..9aa7214 --- /dev/null +++ b/models/Media.js @@ -0,0 +1,22 @@ +const mongoose = require('mongoose'); + +const MediaSchema = new mongoose.Schema({ + file_id: { // The id of the file + type: mongoose.mongo.ObjectId, + required: true + }, + type: { // The type of the file + type: String, + enum: ["file", "avatar", "icon"] + }, + name: { // The name of the file + type: String, + default: "unnamed" + }, + user_id: { // The id of the user that created the file + type: mongoose.mongo.ObjectId, + required: true + } +}); + +module.exports = mongoose.model('media', MediaSchema); \ No newline at end of file