mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
19 lines
No EOL
566 B
CoffeeScript
19 lines
No EOL
566 B
CoffeeScript
mongoose = require 'mongoose'
|
|
jsonschema = require '../../app/schemas/models/earned_achievement'
|
|
|
|
EarnedAchievementSchema = new mongoose.Schema({
|
|
created:
|
|
type: Date
|
|
default: Date.now
|
|
changed:
|
|
type: Date
|
|
default: Date.now
|
|
notified:
|
|
type: Boolean
|
|
default: false
|
|
}, {strict:false})
|
|
|
|
# Maybe consider indexing on changed: -1 as well?
|
|
EarnedAchievementSchema.index({user: 1, achievement: 1}, {unique: true, name: 'earned achievement index'})
|
|
|
|
module.exports = EarnedAchievement = mongoose.model('EarnedAchievement', EarnedAchievementSchema) |