<commit_before>inflection = require 'inflection'
mongoose = require 'mongoose'
uniqueValidator = require 'mongoose-unique-validator'

Route = require '../models/route'
db = require '../lib/database'

fieldSchema = new mongoose.Schema
  name:
    type: String
    unique: no
    required: yes
  slug:
    type: String
    unique: yes
    required: yes
  required: Boolean
  instructions: String
  fieldType:
    type: String
    required: yes
  settings: mongoose.Schema.Types.Mixed

fieldSchema
  .path 'slug'
  .validate (val) ->
    val not in [
      'title'
      'description'
      'slug'
      'status'
      'lastModified'
      'publishDate'
      'createdAt'
      'author'
      'bucket'
      'keywords'
      'content'
    ]
  , 'Sorry, that’s a reserved field slug.'

bucketSchema = new mongoose.Schema
  name:
    type: String
    unique: yes<commit_msg>Don't require field slugs to be unique<commit_after>inflection = require 'inflection'
mongoose = require 'mongoose'
uniqueValidator = require 'mongoose-unique-validator'

Route = require '../models/route'
db = require '../lib/database'

fieldSchema = new mongoose.Schema
  name:
    type: String
    unique: no
    required: yes
  slug:
    type: String
    index: yes
    required: yes
  required: Boolean
  instructions: String
  fieldType:
    type: String
    required: yes
  settings: mongoose.Schema.Types.Mixed

fieldSchema
  .path 'slug'
  .validate (val) ->
    val not in [
      'title'
      'description'
      'slug'
      'status'
      'lastModified'
      'publishDate'
      'createdAt'
      'author'
      'bucket'
      'keywords'
      'content'
    ]
  , 'Sorry, that’s a reserved field slug.'

bucketSchema = new mongoose.Schema
  name:
    type: String
    unique: yes
{'fraction_non_alphanumeric': 0.10272417707150965, 'fraction_numerical': 0.0, 'mean_word_length': 2.5760649087221097, 'pattern_counts': {'":': 0, '<': 3, '<?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': '746100', 'n_tokens_mistral': 550, 'n_tokens_neox': 568, 'n_words': 157}