title: SequelizeEagerLoadingError : associated not working in sequelize
body: <p>I have two tables , Parent table is checkout_product and it's child table is product_attributes
  Now I am creating association between two tables so it's getting error:
  Here is my code</p>
  <pre><code>const Sequelize = require('sequelize');
  const { checkout_product_view } = require('../controller/checkoutProductController');
  const sequelize = new Sequelize('celeb', 'root', '', {
      host: 'localhost',
      dialect:  'mysql' ,
    });
  
  var Checkout_product  = sequelize.define('checkout_products',{
      id: {
          type: Sequelize.INTEGER,
          autoIncrement: true,
          primaryKey: true
      },
      name: {
          type: Sequelize.STRING
      },    
      price : {
          type : Sequelize.STRING
      },
      image : {
          type: Sequelize.STRING
      },
      quantity : {
          type: Sequelize.STRING
      },
  
  
  });
  Checkout_product.associate = function(models) {
      checkout_products.hasMany(models.Product_attributes, {
        foreignKey: 'product_id',
      });
  };
  
  
  sequelize.sync()
  .catch(error =&gt; console.log('This error occured', error));
  
  
  
  module.exports = Checkout_product;
  </code></pre>
  <p>And here is my product_attributes model:</p>
  <pre><code>const Sequelize = require('sequelize');
  const sequelize = new Sequelize('celeb', 'root', '', {
      host: 'localhost',
      dialect:  'mysql' ,
    });
  
  var Product_attribute  = sequelize.define('product_attribute',{
      id: {
          type: Sequelize.INTEGER,
          autoIncrement: true,
          primaryKey: true
      },
      product_id: {
          type: Sequelize.INTEGER
      },    
      attribute_name : {
          type : Sequelize.STRING
      },  
      attribute : {
          type : Sequelize.STRING
      },  
      price : {
          type : Sequelize.STRING
      }
  
  });
  
  Product_attribute.associate = (models) =&gt; {
      Product_attribute.belongsTo(models.Checkout_product, {
          foreign_key: 'product_id',
          sourceKey: 'id'
      });
  };
  
  
  sequelize.sync()
  .then(() =&gt; console.log('Product_attribute'))
  .catch(error =&gt; console.log('This error occured', error));
  
  
  
  module.exports = Product_attribute;
  </code></pre>
  <p>Product has many product_attributes so whenever I called following function getting this error :</p>
  <pre><code>module.exports.checkout_product_get = function (req, res) {
    Checkout_product.findAll({
      include: [ {
        model : Product_attributes
      }]
    })
    .then(checkout_product =&gt; {
      console.log(checkout_product),
      res.json(checkout_product)
    })
  }
  </code></pre>
  <p><strong>Error : UnhandledPromiseRejectionWarning: SequelizeEagerLoadingError: product_attribute is not associated to checkout_products!</strong></p>