2018-04-28 14:44:33 +00:00
|
|
|
const mongoose = require('mongoose');
|
|
|
|
const Config = require('../Config/Config')
|
|
|
|
const Schema = mongoose.Schema;
|
|
|
|
|
|
|
|
const User = new Schema({
|
2018-06-23 11:19:14 +00:00
|
|
|
account_id: {type: Schema.Types.ObjectId, ref: 'Account'},
|
2018-04-28 14:44:33 +00:00
|
|
|
nickname: { type: String, required: true, index: { unique: true } },
|
2018-06-23 11:19:14 +00:00
|
|
|
avatar: { type: String, default: Config.defaults.user.avatar }
|
2018-04-28 14:44:33 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = mongoose.model('User', User);
|