<commit_before><commit_msg>message db model<commit_after>const mongoose = require('mongoose');
const db = require('../config.js');
const Schema = mongoose.Schema;

/**===== Chat model =====**\
 Each 'Plan' will have 1 Chat, therefore we won't need a standalone model
 to track Chat's, we'll just link messages directly to a Plan
 We won't keep track of members of a chat inside the chat, they are already
 tracked inside plan and that will be the source of truth
*/

const messageSchema = new Schema({
  planId: { type: Schema.ObjectId, ref: 'Plan', required: true },
  userId: { type: Schema.ObjectId, ref: 'User', required: true },
  text: String
}, { timestamps: true });

var Message = mongoose.model('Message', MessageSchema);
module.exports = Message;
{'fraction_non_alphanumeric': 0.12945838837516513, 'fraction_numerical': 0.001321003963011889, 'mean_word_length': 4.742424242424242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7420088', 'n_tokens_mistral': 218, 'n_tokens_neox': 213, 'n_words': 91}