<commit_before>'use strict';

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

/**
 * Folder Schema
 */
var FolderSchema = new Schema({
  created         : {
    type    : Date,
    default : Date.now
  },
  modified        : {
    type    : Date,
    default : Date.now
  },
  scanning        : {
    type    : Boolean,
    default : false
  },
  scanned         : {
    type    : Boolean,
    default : false
  },
  lastScanned     : Date,
  foldersCount    : {
    type    : Number,
    default : 0
  },
  filesCount      : {
    type    : Number,
    default : 0
  },
  musicFilesCount : {
    type    : Number,
    default : 0
  },
  path            : {
    type     : String,
    default  : '',
    trim     : true,
    required : 'Path cannot be blank'
  },
  title           : {
    type     : String,
    default  : '',
    trim     : true,
    required : 'Title cannot be blank'
  },
  user            : {
    type : Schema.ObjectId,
    ref  : 'User'
  }
});

mongoose.model('Folder', FolderSchema);<commit_msg>modify the folder schema to make path unique<commit_after>'use strict';

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

/**
 * Folder Schema
 */
var FolderSchema = new Schema({
  created         : {
    type    : Date,
    default : Date.now
  },
  modified        : {
    type    : Date,
    default : Date.now
  },
  scanning        : {
    type    : Boolean,
    default : false
  },
  scanned         : {
    type    : Boolean,
    default : false
  },
  lastScanned     : Date,
  foldersCount    : {
    type    : Number,
    default : 0
  },
  filesCount      : {
    type    : Number,
    default : 0
  },
  musicFilesCount : {
    type    : Number,
    default : 0
  },
  path            : {
    type     : String,
    default  : '',
    trim     : true,
    required : 'Path cannot be blank',
    unique   : true
  },
  title           : {
    type     : String,
    default  : '',
    trim     : true,
    required : 'Title cannot be blank'
  },
  user            : {
    type : Schema.ObjectId,
    ref  : 'User'
  }
});

mongoose.model('Folder', FolderSchema);
{'fraction_non_alphanumeric': 0.12226277372262774, 'fraction_numerical': 0.002737226277372263, 'mean_word_length': 1.570926143024619, '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': '358028', 'n_tokens_mistral': 709, 'n_tokens_neox': 710, 'n_words': 174}