<commit_before>"use strict";

module.exports = function(imports) {

    let mongoose = imports.modules.mongoose;

    let Schema = mongoose.Schema;
    let ObjectId = Schema.Types.ObjectId;

    let chatSchema = new Schema({
        name: {
            type: String,
            required: false
        },
        team: {
            type: ObjectId,
            ref: "Team",
            required: true
        },
        group: Boolean,
        userMembers: [{
            type: ObjectId,
            ref: "User"
        }],
        subdivisionMembers: [{
            type: ObjectId,
            ref: "Subdivision"
        }],
        messages: [{
            author: {
                type: ObjectId,
                ref: "User"
            },
            content: String,
            timestamp: Date
        }],
        created_at: Date,
        updated_at: Date,
    });

    chatSchema.pre("save", function(next) {
        let now = new Date();
        this.updated_at = now;
        if (!this.created_at) {
            this.created_at = now;
        }
        next();
    });

    let Chat = mongoose.model("Chat", chatSchema);

    return Chat;<commit_msg>Replace group, team, userMembers,and  subdivisionMembers with isTwoPeople and group<commit_after>"use strict";

module.exports = function(imports) {

    let mongoose = imports.modules.mongoose;

    let Schema = mongoose.Schema;
    let ObjectId = Schema.Types.ObjectId;

    let chatSchema = new Schema({
        name: {
            type: String,
            required: false
        },

        isTwoPeople: Boolean,
        group: {
            type: ObjectId,
            ref: "Group"
        },

        messages: [{
            author: {
                type: ObjectId,
                ref: "User"
            },
            content: String,
            timestamp: Date
        }],
        created_at: Date,
        updated_at: Date,
    });

    chatSchema.pre("save", function(next) {
        let now = new Date();
        this.updated_at = now;
        if (!this.created_at) {
            this.created_at = now;
        }
        next();
    });

    let Chat = mongoose.model("Chat", chatSchema);

    return Chat;
{'fraction_non_alphanumeric': 0.11024702653247942, 'fraction_numerical': 0.0, 'mean_word_length': 1.43, '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': '5862070', 'n_tokens_mistral': 615, 'n_tokens_neox': 600, 'n_words': 143}