title: Sequelize Many to Many failing with 'is not associated to' when trying to associate entries?
body: <p>I am having a problem with my many to many configuration with Sequelize, where it complains that <code>site_article_keyword is not associated to article_keyword</code>. The code below represents a minimal test case to try to understand what I am doing wrong (I hoped to provide something smaller, but this is what I have). I am using bluebird for the Promise API.</p>
  
  <pre><code>const Sequelize = require('sequelize');
  
  var sequelize = new Sequelize(undefined, undefined, undefined, {
      dialect: 'sqlite',
      storage: './mydatabase',
  });
  
  const SiteArticle = sequelize.define('site_article', {
      id: {
          type: Sequelize.INTEGER,
          primaryKey: true,
          autoIncrement: true
      },
      ownerId: {
          type: Sequelize.INTEGER,
          field: 'owner_id'
      },
      title: Sequelize.STRING
          // other fields omitted
  }, {
      timestamps: true
  });
  
  const ArticleKeyword = sequelize.define('article_keyword', {
      id: {
          type: Sequelize.INTEGER,
          primaryKey: true,
          autoIncrement: true
      },
      name: Sequelize.STRING,
      language: Sequelize.STRING
          // other fields omitted
  }, {
      timestamps: true
  });
  
  const SiteArticleKeyword = sequelize.define('site_article_keyword', {
      siteArticleId: {
          type: Sequelize.INTEGER,
          field: 'site_article_id',
          references: {
              model: SiteArticle,
              key: 'id'
          }
      },
      articleKeywordId: {
          type: Sequelize.INTEGER,
          field: 'article_keyword_id',
          references: {
              model: ArticleKeyword,
              key: 'id'
          }
      }
      // other fields omitted
  }, {
      timestamps: true
  });
  
  (ArticleKeyword).belongsToMany(
      SiteArticle, { through: SiteArticleKeyword });
  
  (SiteArticle).belongsToMany(
      ArticleKeyword, { through: SiteArticleKeyword });
  </code></pre>
  
  <p>That's the model defined, now for trying to create the source and destination entries, that I then want to associate. The failure happens on the line where I call <code>ArticleKeyword.findAll()</code>:</p>
  
  <pre><code>sequelize.sync({}).then(function() {
  
      // populate some data here
  
      let siteArticle;
  
      SiteArticle.create({
          ownerId: 1,
          title: 'hello world'
      }).then(function(entry) {
          siteArticle = entry;
          console.log('site article: ', JSON.stringify(entry, undefined, 2));
  
          return ArticleKeyword.findOrCreate({
              where: {
                  name: 'keyword1',
                  language: 'en'
              }
          });
      }).spread(function(entry, success) {
          console.log('article keyword: ', JSON.stringify(entry, undefined, 2));
          return siteArticle.addArticle_keyword(entry);
      }).spread(function(entry, success) {
          console.log('site article keyword: ', JSON.stringify(entry, undefined, 2));
  
          const siteArticleId = 1;
          const language = 'en';
  
          return ArticleKeyword.findAll({
              where: {
                  language: language,
              },
              include: [{
                  model: SiteArticleKeyword,
                  where: {
                      siteArticleId: siteArticleId
                  }
              }]
          });
      }).then(function(articleKeywords) {
          if (articleKeywords) {
              console.log('entries: ', JSON.stringify(articleKeywords, undefined, 2));
          } else {
              console.log('entries: ', 'none');
          }
      }).catch(function(error) {
          console.log('ERROR: ', error);
      }.bind(this));
  
  }).catch(function(error) {
      console.log(error);
  });
  </code></pre>
  
  <p>I am basing my code on the '<a href="http://docs.sequelizejs.com/en/latest/api/associations/belongs-to-many/#mixin-belongstomany" rel="nofollow noreferrer">Mixin BelongsToMany</a>' example in the Sequelize documentation.</p>
  
  <p>Can anyone suggest what I am doing wrong?</p>