From 45ce1c44c6e3c22110a2b2cdfcf91dda48718852 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Wed, 12 Jul 2017 16:57:12 -0700 Subject: [PATCH] changed model logging --- controllers/statsController.js | 6 ++++++ models/file.js | 1 - models/index.js | 2 +- models/request.js | 1 - 4 files changed, 7 insertions(+), 3 deletions(-) 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: {