<commit_before>/* models/site.js
 * Copyright 2014 <NAME>
 *
 * Licensed under AGPL-3.0 or later, see LICENSE
 * Process Control Service Web Interface
 */

var mongoose = require('mongoose');
var validates = require('./_validates');

var site_schema = new mongoose.Schema({
  name: {
    type: String,
    required: true,
    validate: {
      validator: validates.length({ max: 50 }),
      msg: 'name is too long' },
    trim: true }
});

site_schema.index({ name: 1 });

var Site = mongoose.model('Site', site_schema);

module.exports = Site;

// vim:ts=2 sts=2 sw=2 et:
<commit_msg>site: prepare index for sharding<commit_after>/* models/site.js
 * Copyright 2014 <NAME>
 *
 * Licensed under AGPL-3.0 or later, see LICENSE
 * Process Control Service Web Interface
 */

var mongoose = require('mongoose');
var validates = require('./_validates');

var site_schema = new mongoose.Schema({
  name: {
    type: String,
    required: true,
    validate: {
      validator: validates.length({ max: 50 }),
      msg: 'name is too long' },
    trim: true }
});

site_schema.index({ name: 1 }, { unique: 1 });

var Site = mongoose.model('Site', site_schema);

module.exports = Site;

// vim:ts=2 sts=2 sw=2 et:

{'fraction_non_alphanumeric': 0.148424543946932, 'fraction_numerical': 0.020729684908789386, 'mean_word_length': 3.4538745387453873, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7007392', 'n_tokens_mistral': 413, 'n_tokens_neox': 405, 'n_words': 120}