title: error: column "userId" does not exist Sequelize many-to-many relationsip
body: <p>I try to create a many-to-many relation between users and templates in Postgres with Sequelize. But when I try to create a user I get the following error and can't find what the problem is.</p>
  <pre><code>  Executing (default): INSERT INTO &quot;users&quot; (&quot;id&quot;,&quot;createdAt&quot;,&quot;updatedAt&quot;) VALUES (DEFAULT,$1,$2) RETURNING &quot;id&quot;,&quot;userId&quot;,&quot;templateId&quot;,&quot;createdAt&quot;,&quot;updatedAt&quot;
  error: column &quot;userId&quot; does not exist
  </code></pre>
  <p><strong>User Model</strong></p>
  <pre><code>&quot;use strict&quot;;
  module.exports = (sequelize, DataTypes) =&gt; {
    const user = sequelize.define(
      &quot;user&quot;,
      {
        name: DataTypes.STRING,
        email: DataTypes.STRING,
        phone: DataTypes.STRING,
        password: DataTypes.STRING
      },
      {}
    );
    user.associate = function(models) {
      user.belongsToMany(models.template, {through: 'User_Templates'})
    };
    return user;
  };
  </code></pre>
  <p><strong>Template model</strong></p>
  <pre><code>&quot;use strict&quot;;
  module.exports = (sequelize, DataTypes) =&gt; {
    const template = sequelize.define(
      &quot;template&quot;,
      {
        name: DataTypes.STRING,
        html: DataTypes.STRING
      },
      {}
    );
    template.associate = function(models) {
      template.belongsToMany(models.user, {through: 'User_Templates'})
    };
    return template;
  };
  </code></pre>
  <p><strong>User_Template model (junction table)</strong></p>
  <pre><code>&quot;use strict&quot;;
  module.exports = (sequelize, DataTypes) =&gt; {
    const User_Template = sequelize.define(
      &quot;user&quot;,
      {
        userId: DataTypes.INTEGER,
        templateId: DataTypes.INTEGER
      },
      {}
    );
    User_Template.associate = function(models) {
      User_Template.belongsTo(models.user, {
        foreignKey: 'userId',
        as: 'user'
      })
      User_Template.belongsTo(models.template, {
        foreignKey: 'templateId',
        as: 'template'
      })
    };
    return User_Template;
  };
  </code></pre>