Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / migrations / 2.5.21.js
index 8b41b5b..1d6125d 100644 (file)
@@ -5,114 +5,114 @@ var util = require('util');
 \r
 var logger = require('../config/logger')('migration');\r
 \r
-var Sequence = function () { };\r
+var Sequence = function() {};\r
 \r
-Sequence.prototype.enqueue = function (fn) {\r
+Sequence.prototype.enqueue = function(fn) {\r
   this.tail = this.tail ? this.tail.finally(fn) : fn();\r
 };\r
 \r
-var Migration = function (queryInterface) {\r
+var Migration = function(queryInterface) {\r
   this.queryInterface = queryInterface;\r
   this.sequence = new Sequence();\r
 };\r
 \r
-Migration.prototype.changeColumn = function (table, column, type) {\r
+Migration.prototype.changeColumn = function(table, column, type) {\r
   var _this = this;\r
-  this.sequence.enqueue(function () {\r
+  this.sequence.enqueue(function() {\r
     return _this.queryInterface\r
       .changeColumn(table, column, type)\r
-      .then(function () {\r
+      .then(function() {\r
         logger.info('Changed column %s in table %s', column, table);\r
       })\r
-      .catch(function (err) {\r
+      .catch(function(err) {\r
         logger.info(JSON.stringify(err));\r
       });\r
   });\r
 };\r
 \r
-Migration.prototype.addColumn = function (table, column, type) {\r
+Migration.prototype.addColumn = function(table, column, type) {\r
   var _this = this;\r
-  this.sequence.enqueue(function () {\r
+  this.sequence.enqueue(function() {\r
     return _this.queryInterface\r
       .addColumn(table, column, type)\r
-      .then(function () {\r
+      .then(function() {\r
         logger.info('Added column %s to %s', column, table);\r
       })\r
-      .catch(function (err) {\r
+      .catch(function(err) {\r
         logger.info(JSON.stringify(err));\r
       });\r
   });\r
 };\r
 \r
-Migration.prototype.dropTable = function (table) {\r
+Migration.prototype.dropTable = function(table) {\r
   var _this = this;\r
-  this.sequence.enqueue(function () {\r
+  this.sequence.enqueue(function() {\r
     return _this.queryInterface\r
       .dropTable(table, {\r
         force: true\r
       })\r
-      .then(function () {\r
+      .then(function() {\r
         logger.info('table dropped %s', table);\r
       })\r
-      .catch(function (err) {\r
+      .catch(function(err) {\r
         logger.info(JSON.stringify(err));\r
       });\r
   });\r
 };\r
 \r
-Migration.prototype.addIndex = function (table, column, indexName) {\r
+Migration.prototype.addIndex = function(table, column, indexName) {\r
   var _this = this;\r
-  this.sequence.enqueue(function () {\r
+  this.sequence.enqueue(function() {\r
     return _this.queryInterface\r
       .addIndex(table, column, {\r
         indexName: indexName\r
       })\r
-      .then(function () {\r
+      .then(function() {\r
         logger.info('addIndex %s %s %s', table, column.join(','), indexName);\r
       })\r
-      .catch(function (err) {\r
+      .catch(function(err) {\r
         logger.info(JSON.stringify(err));\r
       });\r
   });\r
 };\r
 \r
-Migration.prototype.removeIndex = function (table, indexName) {\r
+Migration.prototype.removeIndex = function(table, indexName) {\r
   var _this = this;\r
-  this.sequence.enqueue(function () {\r
+  this.sequence.enqueue(function() {\r
     return _this.queryInterface\r
       .removeIndex(table, indexName)\r
-      .then(function () {\r
+      .then(function() {\r
         logger.info('removeIndex %s %s', table, indexName);\r
       })\r
-      .catch(function (err) {\r
+      .catch(function(err) {\r
         logger.info(JSON.stringify(err));\r
       });\r
   });\r
 };\r
 \r
-Migration.prototype.query = function (sql) {\r
+Migration.prototype.query = function(sql) {\r
   var _this = this;\r
-  this.sequence.enqueue(function () {\r
+  this.sequence.enqueue(function() {\r
     return _this.queryInterface.sequelize\r
       .query(sql)\r
-      .then(function () {\r
+      .then(function() {\r
         logger.info('query %s', sql);\r
       })\r
-      .catch(function (err) {\r
+      .catch(function(err) {\r
         logger.info(JSON.stringify(err));\r
       });\r
   });\r
 };\r
 \r
-Migration.prototype.removeColumn = function (table, column) {\r
+Migration.prototype.removeColumn = function(table, column) {\r
   var _this = this;\r
-  this.sequence.enqueue(function () {\r
+  this.sequence.enqueue(function() {\r
     return _this.queryInterface\r
       .removeColumn(table, column)\r
-      .then(function () {\r
+      .then(function() {\r
         logger.info('Removed column %s from %s', column, table);\r
       })\r
-      .catch(function (err) {\r
+      .catch(function(err) {\r
         logger.info(\r
           util.inspect(err, {\r
             showHidden: false,\r
@@ -123,15 +123,15 @@ Migration.prototype.removeColumn = function (table, column) {
   });\r
 };\r
 \r
-Migration.prototype.renameColumn = function (table, oldColumn, newColumn) {\r
+Migration.prototype.renameColumn = function(table, oldColumn, newColumn) {\r
   var _this = this;\r
-  this.sequence.enqueue(function () {\r
+  this.sequence.enqueue(function() {\r
     return _this.queryInterface\r
       .renameColumn(table, oldColumn, newColumn)\r
-      .then(function () {\r
+      .then(function() {\r
         logger.info('Renamed column from %s to %s on %s', oldColumn, newColumn, table);\r
       })\r
-      .catch(function (err) {\r
+      .catch(function(err) {\r
         logger.info(\r
           util.inspect(err, {\r
             showHidden: false,\r
@@ -142,15 +142,15 @@ Migration.prototype.renameColumn = function (table, oldColumn, newColumn) {
   });\r
 };\r
 \r
-Migration.prototype.final = function (resolve) {\r
-  this.sequence.enqueue(function () {\r
+Migration.prototype.final = function(resolve) {\r
+  this.sequence.enqueue(function() {\r
     return resolve();\r
   });\r
 };\r
 \r
 module.exports = {\r
-  up: function (queryInterface, Sequelize) {\r
-    return new BPromise(function (resolve) {\r
+  up: function(queryInterface, Sequelize) {\r
+    return new BPromise(function(resolve) {\r
       var migration = new Migration(queryInterface);\r
 \r
       // START team_has_voice_queues\r
@@ -163,7 +163,7 @@ module.exports = {
     });\r
   },\r
 \r
-  down: function (queryInterface, Sequelize) {\r
+  down: function(queryInterface, Sequelize) {\r
     // var migration = new Migration(queryInterface);\r
   }\r
-};\r
+};
\ No newline at end of file