codecombat/server/purchases/Purchase.coffee
2015-03-21 21:49:32 -04:00

6 lines
333 B
CoffeeScript

mongoose = require('mongoose')
config = require '../../server_config'
PurchaseSchema = new mongoose.Schema({status: String}, {strict: false,read:config.mongo.readpref})
PurchaseSchema.index({recipient: 1, 'purchased.original': 1}, {unique: true, name: 'unique purchase'})
module.exports = mongoose.model('purchase', PurchaseSchema)