title: How to control the inner join query in sequelize using node.js?
body: <p>Days model:</p>
  <pre><code>workoutId: {
      type: Sequelize.INTEGER,
  },
  traineeId: {
    type: Sequelize.INTEGER,
    primaryKey: true
  },
  dayNumber: {
    type: Sequelize.INTEGER,
    primaryKey: true
  },
  status: {
    type: Sequelize.INTEGER
  },
  </code></pre>
  <p>WorkoutsExercises model:</p>
  <pre><code>workout_id: {
    type: Sequelize.INTEGER,
    primaryKey: true
  },
  exercise_name: {
    type: Sequelize.INTEGER,
    primaryKey: true
  },
  coach_id: {
    type: Sequelize.INTEGER,
    primaryKey: true
  }
  </code></pre>
  <p>I just want to make an inner join between the two tables to return all exercises in each day, I use the following</p>
  <pre><code>const Days = require('../models/days');
  const WorkoutsExercises = require('../models/workoutsExercises');
  
  Days.findAll({
    include: [{
      model: WorkoutsExercises,
        required: true
     }]        
  })
  </code></pre>
  <p>And this function returns the following query:</p>
  <pre><code>SELECT
    `day`.`workoutId`,
    `day`.`dayNumber`,
    `day`.`status`,
    `day`.`traineeId`,
    
    `workoutsExercises`.`workout_id` AS `workoutsExercises.workout_id`, 
    `workoutsExercises`.`exercise_name` AS `workoutsExercises.exercise_name`, 
    `workoutsExercises`.`coach_id` AS `workoutsExercises.coach_id`
  
  FROM `days` AS `day`
  
  INNER JOIN `workoutsExercises` AS `workoutsExercises` 
  
  ON `day`.`dayNumber` = `workoutsExercises`.`workout_id`; 
  </code></pre>
  <p>how can I change the on condition from (<code>day</code>.<code>dayNumber</code>) to (<code>day</code>.<code>workoutId</code>)</p>