mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
28 lines
792 B
JavaScript
28 lines
792 B
JavaScript
import mongoose from 'mongoose';
|
|
import baseModel from '../libs/baseModel';
|
|
|
|
const schema = new mongoose.Schema({
|
|
timestamp: Date,
|
|
user: String,
|
|
text: String,
|
|
info: {type: mongoose.Schema.Types.Mixed},
|
|
contributor: {type: mongoose.Schema.Types.Mixed},
|
|
backer: {type: mongoose.Schema.Types.Mixed},
|
|
uuid: String,
|
|
id: String,
|
|
groupId: {type: String, ref: 'Group'},
|
|
flags: {type: mongoose.Schema.Types.Mixed, default: {}},
|
|
flagCount: {type: Number, default: 0},
|
|
likes: {type: mongoose.Schema.Types.Mixed},
|
|
userStyles: {type: mongoose.Schema.Types.Mixed},
|
|
_meta: {type: mongoose.Schema.Types.Mixed},
|
|
}, {
|
|
minimize: false, // Allow for empty flags to be saved
|
|
});
|
|
|
|
schema.plugin(baseModel, {
|
|
noSet: ['_id'],
|
|
});
|
|
|
|
export const model = mongoose.model('Chat', schema);
|