Files
dragonroll/backend/src/models/Campaign.js
Aran Roig 1402045001
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 1m51s
Foundry and discord bot
2026-10-11 22:26:29 +02:00

25 lines
847 B
JavaScript

const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const CampaignSchema = new Schema({
name: {type: String, required: true},
description: {type: String},
color: {type: String},
createdBy: {
type: Schema.Types.ObjectId,
ref: 'User',
required: true
},
date: { type: Date, default: Date.now},
settings: { type: Object },
foundryWorldId: { type: String, unique: true, sparse: true },
foundryWorldTitle: { type: String },
foundrySystem: { type: String },
foundrySyncTokenHash: { type: String, select: false },
// Discord server ("guild") this campaign is linked to. A campaign serves
// at most one guild, and a guild selects one campaign.
discordGuildId: { type: String, index: true }
});
module.exports = mongoose.model('Campaign', CampaignSchema);