4 var moment = require('moment');
6 module.exports = function(sequelize, DataTypes) {
8 var ExtractedReport = sequelize.define('ExtractedReport', {
9 name: DataTypes.STRING,
10 output: DataTypes.STRING, //csv,pdf,..
11 savename: DataTypes.STRING,
15 // 'this' allows you to access attributes of the instance
16 return moment(this.getDataValue('startDate')).format("DD-MM-YYYY").toString();
22 // 'this' allows you to access attributes of the instance
23 return moment(this.getDataValue('endDate')).format("DD-MM-YYYY").toString();
27 type: DataTypes.STRING,
28 defaultValue: 'Loading'
33 // 'this' allows you to access attributes of the instance
34 return moment(this.getDataValue('createdAt')).format("DD-MM-YYYY").toString();
38 tableName: 'analytics_extracted_reports',
39 // associate: function(models) {
40 // Tag.belongsToMany(models.Contact, {
41 // through: 'contact_tags'
46 return ExtractedReport;