changed model logging
This commit is contained in:
parent
99c7c84cfb
commit
45ce1c44c6
4 changed files with 7 additions and 3 deletions
|
@ -154,10 +154,16 @@ module.exports = {
|
||||||
createdAt: {
|
createdAt: {
|
||||||
gt: startDate,
|
gt: startDate,
|
||||||
},
|
},
|
||||||
|
FileId: {
|
||||||
|
not: null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
include: [db.File],
|
include: [db.File],
|
||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
if (data) {
|
||||||
|
logger.debug(data[0].File.name);
|
||||||
|
}
|
||||||
// let resultHashTable = {};
|
// let resultHashTable = {};
|
||||||
// let sortableArray = [];
|
// let sortableArray = [];
|
||||||
// let sortedArray;
|
// let sortedArray;
|
||||||
|
|
|
@ -46,7 +46,6 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER }) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
File.associate = db => {
|
File.associate = db => {
|
||||||
console.log('test');
|
|
||||||
File.hasMany(db.Request);
|
File.hasMany(db.Request);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ fs
|
||||||
|
|
||||||
Object.keys(db).forEach(modelName => {
|
Object.keys(db).forEach(modelName => {
|
||||||
if (db[modelName].associate) {
|
if (db[modelName].associate) {
|
||||||
logger.verbose('associating', modelName);
|
logger.info('Associating model:', modelName);
|
||||||
db[modelName].associate(db);
|
db[modelName].associate(db);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,7 +26,6 @@ module.exports = (sequelize, { STRING, BOOLEAN, TEXT }) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
Request.associate = db => {
|
Request.associate = db => {
|
||||||
console.log('test');
|
|
||||||
Request.belongsTo(db.File, {
|
Request.belongsTo(db.File, {
|
||||||
onDelete : 'cascade',
|
onDelete : 'cascade',
|
||||||
foreignKey: {
|
foreignKey: {
|
||||||
|
|
Loading…
Reference in a new issue