title: Problems with "includes" using Sequelize when a composite foreign key is used
body: <p>Here is a sample of my main table:</p>
  
  <pre><code>+-------------+------------------------+--------------------+
  | tenant      | vas_id                 | friendly_name      |
  +-------------+------------------------+--------------------+
  | brand_1     | 1gb_data_zone1         | 1GB Data in Zone 1 |
  | brand_1     | promo_summer_2019_10GB | 10GB for Summer    |
  | brand_1     | roaming_prepaid        | Roaming            |
  | brand_1     | voicemail_prepaid      | Voicemail          |
  | brand_2     | test_vas               | Test               |
  | brand_2     | roaming_prepaid        | Roaming            |
  | brand_2     | voicemail_prepaid      | Voicemail          |
  +-------------+------------------------+--------------------+
  </code></pre>
  
  <p><code>tenant</code> and <code>vas_id</code> are the two primary keys (a.k.a. composite primary keys) in this table, and they are used together as constain to another table, 1:N relationship:</p>
  
  <pre><code>+---------+------------------------+-----------------+-------------------+-------------------+
  | tenant  | vas_id                 | activation_cost | deactivation_cost | modification_cost |
  +---------+------------------------+-----------------+-------------------+-------------------+
  | brand_1 | 1gb_data_zone1         |            2000 |                 0 |                 0 |
  | brand_1 | promo_summer_2019_10GB |               0 |                 0 |                 0 |
  | brand_1 | roaming_prepaid        |               0 |                 0 |                 0 |
  | brand_1 | voicemail_prepaid      |               0 |                 0 |                 0 |
  | brand_2 | test_vas               |               0 |                 0 |                 0 |
  | brand_2 | roaming_prepaid        |               0 |                 0 |                 0 |
  | brand_2 | voicemail_prepaid      |               0 |                 0 |                 0 |
  +---------+------------------------+-----------------+-------------------+-------------------
  </code></pre>
  
  <p><strong>Would you say that this structure can get along with Sequelize?</strong></p>
  
  <p>Here is the code that I use to mark the two primary keys:</p>
  
  <pre><code>const vas = serviceLayerDB.define('vas',
      { // Database columns:
          tenant: {
              type: Sequelize.STRING(45),
              primaryKey: true
          },
          vas_id: {
              type: Sequelize.STRING(100),
              primaryKey: true
          }
          friendly_name: {
              type: Sequelize.STRING(100)
          }
      }
  
  const vas_pricing = serviceLayerDB.define('vas_pricing',
      { // Database columns:
          tenant: {
              type: Sequelize.STRING(45),
              primaryKey: true
          },
          vas_id: {
              type: Sequelize.STRING(100),
              primaryKey: true
          },
          activation_cost: {
              type: Sequelize.NUMBER
          },
          deactivation_cost: {
              type: Sequelize.NUMBER
          },
          modification_cost: {
              type: Sequelize.NUMBER
          }
      });
  </code></pre>
  
  <p>...and this is the code that I use to relate the table above with another table (vas_pricing):</p>
  
  <pre><code>vas.hasOne(vas_pricing, { foreignKey: 'vas_id' });
  vas.hasOne(vas_pricing, { foreignKey: 'tenant' });
  </code></pre>
  
  <p><strong>Strange things happen, for example, while executing the following code that finds on the main table AND also in the child table:</strong></p>
  
  <pre><code>let options = {
      where: {
          tenant: 'brand_1',
          vas_id: 'promo_summer_2019_10GB'
      },
      include: [
          {
              model: vas_pricing,
              required: false
          }
      ]
  };
  vas.findAll(options)
      .then(function(data) {
          console.log(JSON.stringify(data, null, 2))
      })
      .catch(function(error) {
          console.error(error);
      });
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>[
      {
          "tenant": "brand_1",
          "vas_id": "promo_summer_2019_10GB",
          "friendly_name": "10GB During Summer",
          "vas_pricing": {
              "tenant": "brand_1",
              "vas_id": "1gb_data_zone1",
              "activation_cost": 20,
              "deactivation_cost": 0,
              "modification_cost": 0
          }
      },
      {
          "tenant": "brand_1",
          "vas_id": "promo_summer_2019_10GB",
          "friendly_name": "10GB During Summer",
          "vas_pricing": {
              "tenant": "brand_1",
              "vas_id": "promo_summer_2019_10GB",
              "activation_cost": 0,
              "deactivation_cost": 0,
              "modification_cost": 0
          }
      },
      {
          "tenant": "brand_1",
          "vas_id": "promo_summer_2019_10GB",
          "friendly_name": "10GB During Summer",
          "vas_pricing": {
              "tenant": "brand_1",
              "vas_id": "roaming_prepaid",
              "activation_cost": 0,
              "deactivation_cost": 0,
              "modification_cost": 0
          }
      },
      {
          "tenant": "brand_1",
          "vas_id": "promo_summer_2019_10GB",
          "friendly_name": "10GB During Summer",
          "vas_pricing": {
              "tenant": "brand_1",
              "vas_id": "voicemail_prepaid",
              "activation_cost": 0,
              "deactivation_cost": 0,
              "modification_cost": 0
          }
      }
  ]
  </code></pre>
  
  <p>Expected result:</p>
  
  <pre><code>[
      {
          "tenant": "brand_1",
          "vas_id": "promo_summer_2019_10GB",
          "friendly_name": "10GB During Summer",
          "vas_pricing": {
              "tenant": "brand_1",
              "vas_id": "promo_summer_2019_10GB",
              "activation_cost": 0,
              "deactivation_cost": 0,
              "modification_cost": 0
          }
      }
  ]
  </code></pre>
  
  <p>I have been banging my head for days looking for a solution without success. Any ideas?</p>