2 var moment = require('moment');
4 module.exports = function(sequelize, DataTypes) {
5 var VoiceRecording = sequelize.define('VoiceRecording', {
10 type: DataTypes.STRING,
11 set: function(channel) {
13 this.setDataValue('channel', channel);
14 this.setDataValue('membername', channel.split(/\/|-/)[1]);
19 type: DataTypes.STRING
22 type: DataTypes.STRING
25 type: DataTypes.STRING
28 type: DataTypes.STRING
31 type: DataTypes.STRING
34 type: DataTypes.STRING
37 type: DataTypes.STRING
40 type: DataTypes.STRING
43 type: DataTypes.STRING
46 type: DataTypes.STRING
49 type: DataTypes.STRING
52 type: DataTypes.INTEGER,
60 type: DataTypes.STRING
65 // 'this' allows you to access attributes of the instance
66 return moment(this.getDataValue('createdAt')).format("MM-DD-YYYY HH:mm").toString();
72 // 'this' allows you to access attributes of the instance
73 return moment(this.getDataValue('updatedAt')).format("MM-DD-YYYY HH:mm").toString();
77 tableName: 'voice_recordings',
78 associate: function(models) {
79 // VoiceRecording.belongsTo(models.ReportCall, {
80 // foreignKey: 'uniqueid'
85 return VoiceRecording;