Built motion from commit 1038d87.|0.0.141
[motion.git] / server / models / tools_trunk.js
index e62789c..f9df7ff 100644 (file)
@@ -1,8 +1,6 @@
 'use strict';
 
-var crypto = require('crypto');
-var md5 = require('md5');
-var _ = require('lodash');
+
 
 module.exports = function(sequelize, DataTypes) {
   var Trunk = sequelize.define('Trunk', {
@@ -410,7 +408,7 @@ module.exports = function(sequelize, DataTypes) {
     call_limit: {
       type: DataTypes.INTEGER(11),
       allowNull: true,
-      defaultValue: null
+      defaultValue: 1000
     },
     registertrying: { //Send a 100 Trying when the device registers.
       type: DataTypes.ENUM('yes', 'no'),
@@ -467,11 +465,5 @@ module.exports = function(sequelize, DataTypes) {
     tableName: 'tools_trunks'
   });
 
-  Trunk.beforeUpdate(function(doc) {
-    if (doc.changed('name')) {
-      throw new Error("You can't modify a trunk name");
-    }
-  });
-
   return Trunk;
 }