codecombat/server/campaigns/Campaign.coffee

14 lines
521 B
CoffeeScript
Raw Normal View History

mongoose = require 'mongoose'
plugins = require '../plugins/plugins'
CampaignSchema = new mongoose.Schema(body: String, {strict: false})
CampaignSchema.index({i18nCoverage: 1}, {name: 'translation coverage index', sparse: true})
CampaignSchema.index({slug: 1}, {name: 'slug index', sparse: true, unique: true})
CampaignSchema.plugin(plugins.NamedPlugin)
CampaignSchema.plugin(plugins.TranslationCoveragePlugin)
CampaignSchema.plugin plugins.PatchablePlugin
module.exports = mongoose.model('campaign', CampaignSchema)