mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-29 18:45:48 -05:00
58716f5b75
Saw that this caused 500s on /auth/whoami with no cookies set, with this error:
debug: 500: MongoError: E11000 duplicate key error index: coco.users.$emailLower_1 dup key: { : null }
Probably we need to be much more careful about what changes this blanket change to the minimize Mongoose option might introduce, since tests didn't catch this, but it would have taken the site down for anyone not logged in already.
This reverts commit 121f07d020
.
6 lines
268 B
CoffeeScript
6 lines
268 B
CoffeeScript
mongoose = require('mongoose')
|
|
|
|
PurchaseSchema = new mongoose.Schema({status: String}, {strict: false})
|
|
PurchaseSchema.index({recipient: 1, 'purchased.original': 1}, {unique: true, name: 'unique purchase'})
|
|
|
|
module.exports = mongoose.model('purchase', PurchaseSchema)
|