2018-03-12 09:26:44 +01:00
|
|
|
'use strict';
|
2017-08-12 16:28:18 +02:00
|
|
|
|
|
|
|
const mongoose = require('mongoose');
|
|
|
|
const Schema = mongoose.Schema;
|
|
|
|
|
|
|
|
const CampaignSchema = new Schema({
|
|
|
|
title: {
|
|
|
|
type: String,
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
|
|
|
},
|
2019-08-04 13:16:11 +02:00
|
|
|
fractionMappingBlufor: {
|
|
|
|
type: String,
|
|
|
|
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'],
|
|
|
|
default: 'BLUFOR',
|
|
|
|
},
|
|
|
|
fractionMappingOpfor: {
|
|
|
|
type: String,
|
|
|
|
enum: ['BLUFOR', 'OPFOR', 'ARF', 'SWORD'],
|
|
|
|
default: 'OPFOR',
|
|
|
|
},
|
2017-08-12 16:28:18 +02:00
|
|
|
}, {
|
|
|
|
collection: 'campaign',
|
2018-03-12 09:26:44 +01:00
|
|
|
timestamps: {createdAt: 'timestamp'},
|
2017-08-12 16:28:18 +02:00
|
|
|
});
|
|
|
|
// optional more indices
|
|
|
|
CampaignSchema.index({timestamp: 1});
|
|
|
|
|
|
|
|
module.exports = mongoose.model('Campaign', CampaignSchema);
|