title: Sequelize raw query is returning duplicate data
body: <p>So, I've got a query that returns some reports made by users, the code is:</p>
  <pre><code>const reports = await database.query(
    'SELECT r.id, r.type, r.fileCid, r.madeById, r.reportedId, u1.username as reportedName, u2.username as madeBy \
    FROM reports r \
    left join users u1 on u1.id = r.reportedId \
    inner join users u2 on u2.id = r.madeById '
  );
  
  return reports;
  </code></pre>
  <p>and if I run it on my database directly, it returns this sample data:</p>
  <pre><code>+----+------+------------------------------------------------+----------+------------+--------------+--------+
  | id | type | fileCid | madeById | reportedId | reportedName | madeBy |
  +----+------+------------------------------------------------+----------+------------+--------------+--------+
  |  5 |    1 | cidF    |        4 |       NULL | NULL         | username    |
  |  6 |    0 | cidF    |        4 |       NULL | NULL         | username    |
  +----+------+------------------------------------------------+----------+------------+--------------+--------+
  </code></pre>
  <p>So my expected result as object would be:</p>
  <pre><code>[{
          &quot;id&quot;: 5,
          &quot;type&quot;: 1,
          &quot;fileCid&quot;: &quot;cidF&quot;,
          &quot;madeById&quot;: 4,
          &quot;reportedId&quot;: null,
          &quot;reportedName&quot;: null,
          &quot;madeBy&quot;: &quot;ftk&quot;
      }, {
          &quot;id&quot;: 6,
          &quot;type&quot;: 0,
          &quot;fileCid&quot;: &quot;cidF&quot;,
          &quot;madeById&quot;: 4,
          &quot;reportedId&quot;: null,
          &quot;reportedName&quot;: null,
          &quot;madeBy&quot;: &quot;ftk&quot;
      }]
  </code></pre>
  <p>but it is indeed returning an array of arrays of this data duplicated:</p>
  <pre><code>[
      [{
          &quot;id&quot;: 5,
          &quot;type&quot;: 1,
          &quot;fileCid&quot;: &quot;cidF&quot;,
          &quot;madeById&quot;: 4,
          &quot;reportedId&quot;: null,
          &quot;reportedName&quot;: null,
          &quot;madeBy&quot;: &quot;ftk&quot;
      }, {
          &quot;id&quot;: 6,
          &quot;type&quot;: 0,
          &quot;fileCid&quot;: &quot;cidF&quot;,
          &quot;madeById&quot;: 4,
          &quot;reportedId&quot;: null,
          &quot;reportedName&quot;: null,
          &quot;madeBy&quot;: &quot;ftk&quot;
      }],
      [{
          &quot;id&quot;: 5,
          &quot;type&quot;: 1,
          &quot;fileCid&quot;: &quot;cidF&quot;,
          &quot;madeById&quot;: 4,
          &quot;reportedId&quot;: null,
          &quot;reportedName&quot;: null,
          &quot;madeBy&quot;: &quot;ftk&quot;
      }, {
          &quot;id&quot;: 6,
          &quot;type&quot;: 0,
          &quot;fileCid&quot;: &quot;cidF&quot;,
          &quot;madeById&quot;: 4,
          &quot;reportedId&quot;: null,
          &quot;reportedName&quot;: null,
          &quot;madeBy&quot;: &quot;ftk&quot;
      }]
  ]
  </code></pre>
  <p>Why is this happening? it's clearly a problem on sequelize since if I run it directly on MySql is returns only 2 registers as expected... Also, not a duplicated question <a href="https://stackoverflow.com/q/51118940/2414842">from this one</a>, although it may seems</p>
  <p><strong>Edit</strong>
  This is how the report's table is defined. I'm just guessing that because I use two foreign keys to the same table maybe sequelize is making this bug:</p>
  <pre><code>const Report = database.define('report', {
    id: {
      type: Sequelize.INTEGER,
      autoIncrement: true,
      allowNull: false,
      primaryKey: true
    },
    type: {
        type: Sequelize.INTEGER,
        allowNull: false
    }
  },
  {
    updatedAt: false
  }
  )
  
  Report.belongsTo(User, {as: 'madeBy'});
  Report.belongsTo(User, {as: 'reported'});
  Report.belongsTo(File);
  </code></pre>