title: Two foreign Key of same table in one table in sequelize
body: <p>my team member model :-</p>
  
  <pre><code>var teamMember = {
      id: {
          type: DataTypes.INTEGER,
          primaryKey: true,
          autoIncrement: true
      },
      level: DataTypes.INTEGER,
      supervisorId: {
          type: DataTypes.INTEGER,
          references: {
              model: "employees",
              key: "id"
          }
      },
      employeeId: {
          type: DataTypes.INTEGER,
          unique: true,
          references: {
              model: "employees",
              key: "id"
          }
      }
  </code></pre>
  
  <p>and there is employee model</p>
  
  <p>mapping:-</p>
  
  <pre><code>db.employee.hasOne(db.teamMember);
  db.teamMember.belongsTo(db.employee);
  </code></pre>
  
  <p>my query function </p>
  
  <pre><code>        db.teamMember.findOne({
          where: { employeeId: req.employee.id },
          include: [db.employee]
  
      })
      .then(teamMember =&gt; {
          if (!teamMember) {
              throw ('no teamMember found');
          }
         consol.log(teamMember)
      })
  </code></pre>
  
  <p>my <strong>teamMember</strong> table is like=</p>
  
  <p>id------employeeId------supervisorId  </p>
  
  <p>2 ----------- 4 ------------- 5 </p>
  
  <p>Problem is -: so when i m asking for row in teamMember whose employeeId is 4. that should be include with supervisorId(JOIN) and it returns row with employee included of 4 (id) . i want employee of 5th id .</p>
  
  <p><strong>Both supervisorId and employeeId are reffer to employee table.</strong></p>