diff --git a/controllers/statsController.js b/controllers/statsController.js index 4a8ebcdc..acfcddc5 100644 --- a/controllers/statsController.js +++ b/controllers/statsController.js @@ -154,10 +154,16 @@ module.exports = { createdAt: { gt: startDate, }, + FileId: { + not: null, + }, }, include: [db.File], }) .then(data => { + if (data) { + logger.debug(data[0].File.name); + } // let resultHashTable = {}; // let sortableArray = []; // let sortedArray; diff --git a/models/file.js b/models/file.js index 36fa4937..5c8ff364 100644 --- a/models/file.js +++ b/models/file.js @@ -46,7 +46,6 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER }) => { ); File.associate = db => { - console.log('test'); File.hasMany(db.Request); }; diff --git a/models/index.js b/models/index.js index 2eab32b6..16b5c3db 100644 --- a/models/index.js +++ b/models/index.js @@ -32,7 +32,7 @@ fs Object.keys(db).forEach(modelName => { if (db[modelName].associate) { - logger.verbose('associating', modelName); + logger.info('Associating model:', modelName); db[modelName].associate(db); } }); diff --git a/models/request.js b/models/request.js index 0918603d..846e12c6 100644 --- a/models/request.js +++ b/models/request.js @@ -26,7 +26,6 @@ module.exports = (sequelize, { STRING, BOOLEAN, TEXT }) => { ); Request.associate = db => { - console.log('test'); Request.belongsTo(db.File, { onDelete : 'cascade', foreignKey: {