From 76a5944bac8b111bb53d223a3ffc9a7800e58b74 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Sun, 26 Jun 2022 17:03:47 +0200 Subject: [PATCH] Created the release model / schema --- models/Release.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 models/Release.js diff --git a/models/Release.js b/models/Release.js new file mode 100644 index 0000000..1b97f71 --- /dev/null +++ b/models/Release.js @@ -0,0 +1,30 @@ +const mongoose = require('mongoose'); + +const ReleaseSchema = new mongoose.Schema({ + addon_id: { // The id of the addon for which this release is intended + type: mongoose.mongo.ObjectId, + required: true + }, + version: { // The version of the release (semver) + type: String, + required: true + }, + mc_versions: { // The allowed minecraft versions + type: [String], + default: ["1.19"] + }, + description: { // The description of the release (ex. what changed) + type: String, + default: "The author of this addon has not provided a description" + }, + downloads: { // The number of downloads that the release has reached + type: Number, + default: 0 + }, + created: { // The date of when the release has been created + type: Date, + default: Date.now + } +}); + +module.exports = mongoose.model('releases', ReleaseSchema); \ No newline at end of file