Created the release model / schema

This commit is contained in:
Mathias Wagner 2022-06-26 17:03:47 +02:00
parent 3dcdbc2027
commit 76a5944bac
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

30
models/Release.js Normal file
View File

@ -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);