Built motion from commit 1038d87.|0.0.141
[motion.git] / server / migrations / 20160909092524-voice_recordings.js
1 'use strict';
2
3 module.exports = {
4   up: function(queryInterface, Sequelize) {
5     return queryInterface.addColumn('voice_recordings', 'customerPhone', {
6         type: Sequelize.STRING
7       })
8       .then(function() {
9         return queryInterface.sequelize.query('UPDATE voice_recordings SET customerPhone = IF(type=\'outbound\',exten,calleridnum)');
10       })
11   },
12
13   down: function(queryInterface, Sequelize) {
14     queryInterface.sequelize.query('ALTER TABLE `voice_recordings` DROP COLUMN customerPhone;');
15   }
16 };