<commit_before>'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
  utils = require('../utils/uuid.server.utils'),
  Schema = mongoose.Schema;

/**
 * Profile Schema
 */
var ProfileSchema = new Schema({
  userID: {
    type: String,
    trim: true
  },
  loginInfo: {
    providerID: {
      type: String,
      trim: true
    },
    providerKey: {
      type: String,
      trim: true
    }
  },
  firstName: {
    type: String,
    trim: true
  },
  lastName: {
    type: String,
    trim: true
  },
  fullName: {
    type: String,
    trim: true
  },
  email: {
    type: String,
    trim: true
  },
  preferredLang: {
    code: {
      type: String,
      trim: true
    }
  },
  avatarURL: {
    type: String,
    trim: true
  },
  updated: {
    type: Date
  },
  created: {
    type: Date,
    default: Date.now
  },
  gitID: {
    type: String,
    trim: true
  }
});

/**
 * Find possible not used gitID
 */
ProfileSchema.statics.findUniqueGitID = function (callback) {
  var _this = this;
  var gitID = utils.guid();

  _this.findOne({
    gitID: gitID
  }, function (err, profile) {
    if (!err) {
      if (!profile) {
        callback(gitID);
      } else {
        return _this.findUniqueGitID(callback);
      }
    } else {
      callback(null);
    }
  });
};

mongoose.model('Profile', ProfileSchema);<commit_msg>Add trackUser to the model of profiles<commit_after>'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
  utils = require('../utils/uuid.server.utils'),
  Schema = mongoose.Schema;

/**
 * Profile Schema
 */
var ProfileSchema = new Schema({
  userID: {
    type: String,
    trim: true
  },
  loginInfo: {
    providerID: {
      type: String,
      trim: true
    },
    providerKey: {
      type: String,
      trim: true
    }
  },
  firstName: {
    type: String,
    trim: true
  },
  lastName: {
    type: String,
    trim: true
  },
  fullName: {
    type: String,
    trim: true
  },
  email: {
    type: String,
    trim: true
  },
  preferredLang: {
    code: {
      type: String,
      trim: true
    }
  },
  avatarURL: {
    type: String,
    trim: true
  },
  updated: {
    type: Date
  },
  created: {
    type: Date,
    default: Date.now
  },
  gitID: {
    type: String,
    trim: true
  },
  trackUser: {
    type: Boolean
  }
});

/**
 * Find possible not used gitID
 */
ProfileSchema.statics.findUniqueGitID = function (callback) {
  var _this = this;
  var gitID = utils.guid();

  _this.findOne({
    gitID: gitID
  }, function (err, profile) {
    if (!err) {
      if (!profile) {
        callback(gitID);
      } else {
        return _this.findUniqueGitID(callback);
      }
    } else {
      callback(null);
    }
  });
};

mongoose.model('Profile', ProfileSchema);
{'fraction_non_alphanumeric': 0.1443926907918309, 'fraction_numerical': 0.0, 'mean_word_length': 2.102222222222222, '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': '4872118', 'n_tokens_mistral': 970, 'n_tokens_neox': 975, 'n_words': 226}