2 var moment = require('moment');
4 module.exports = function(sequelize, DataTypes) {
5 var VoiceRecording = sequelize.define('VoiceRecording', {
7 type: DataTypes.STRING,
11 type: DataTypes.STRING,
12 set: function(channel) {
14 this.setDataValue('channel', channel);
15 this.setDataValue('membername', channel.split(/\/|-/)[1]);
20 type: DataTypes.STRING
23 type: DataTypes.STRING
26 type: DataTypes.STRING
29 type: DataTypes.STRING
32 type: DataTypes.STRING
35 type: DataTypes.STRING
38 type: DataTypes.STRING
41 type: DataTypes.STRING
44 type: DataTypes.STRING
47 type: DataTypes.STRING
50 type: DataTypes.STRING
53 type: DataTypes.INTEGER,
61 type: DataTypes.STRING
66 // 'this' allows you to access attributes of the instance
67 return moment(this.getDataValue('createdAt')).format("MM-DD-YYYY HH:mm").toString();
73 // 'this' allows you to access attributes of the instance
74 return moment(this.getDataValue('updatedAt')).format("MM-DD-YYYY HH:mm").toString();
78 tableName: 'voice_recordings',
79 associate: function(models) {
80 // VoiceRecording.belongsTo(models.ReportCall, {
81 // foreignKey: 'uniqueid'
86 return VoiceRecording;