users.hasMany(tasks, { foreignKey: 'id_user', as: 'userTasks' })
tasks.belongsTo(users, { foreignKey: 'id_user', as: 'userTasks' })
users.findOne({
include: [{
model: models.tasks,
as: 'userTasks'
}]
}).then(data => {
console.log(data)
}).catch(error => {
console.error(error)
})