5 var moment = require('moment');
7 module.exports = function(sequelize, DataTypes) {
9 var ReportOpenchannelHistory = sequelize.define('ReportOpenchannelHistory', {
10 uniqueid: DataTypes.STRING,
11 timeslot: DataTypes.INTEGER,
12 accountid: DataTypes.STRING,
13 accountname: DataTypes.STRING,
14 application: DataTypes.STRING,
15 memberid: DataTypes.INTEGER,
16 membername: DataTypes.STRING,
17 queue: DataTypes.INTEGER,
18 queuename: DataTypes.STRING,
19 roomid: DataTypes.INTEGER,
20 messageid: DataTypes.INTEGER,
22 type: DataTypes.STRING,
23 defaultValue: 'called'
26 type: DataTypes.STRING,
29 this.setDataValue('connectid', this.uniqueid);
30 this.setDataValue('reason', 'connect');
31 this.setDataValue('connectedAt', moment().format("YYYY-MM-DD HH:mm:ss"));
34 calledAt: DataTypes.DATE,
35 rejectedAt: DataTypes.DATE,
36 connectedAt: DataTypes.DATE
38 tableName: 'report_openchannel_history'
40 ReportOpenchannelHistory.removeAttribute('id');
41 return ReportOpenchannelHistory;