title: Unknown column 'users.email' in 'where clause' at Query.formatError
body: <p><strong>I need help with some code. This is my signup function</strong> :</p>
  
  <pre><code>exports.signup = (req, res) =&gt; {
  // Save User to Database
  console.log("Processing func -&gt; SignUp");
  
  User.create({
      name: req.body.name,
      username: req.body.username,
      lname: req.body.lastname,
      email: req.body.email,
      password: bcrypt.hashSync(req.body.password, 8)
  }).then(user =&gt; {
      Role.findAll({
          where: {
              name: {
                  [Op.or]: req.body.roles
              }
          }
      }).then(roles =&gt; {
          user.setRoles(roles).then(() =&gt; {
              res.send("User registered successfully!");
          });
      }).catch(err =&gt; {
          res.status(500).send("Error -&gt; " + err);
      });
  }).catch(err =&gt; {
      res.status(500).send("Fail! Error -&gt; " + err);
  })
  </code></pre>
  
  <p>}</p>
  
  <p><strong>this is my check user</strong></p>
  
  <pre><code>checkDuplicateUserNameOrEmail = (req, res, next) =&gt; {
  // -&gt; Check Username is already in use
  User.findOne({
      where: {
          username: req.body.username
      }
  }).then(user =&gt; {
      if (user) {
          res.status(400).send("Fail -&gt; Username is already taken!");
          return;
      }
  
      // -&gt; Check Email is already in use
      User.findOne({
          where: {
              email: req.body.email
          }
      }).then(user =&gt; {
          if (user) {
              res.status(400).send("Fail -&gt; Email is already in use!");
              return;
          }
  
          next();
      });
  });
  </code></pre>
  
  <p>}</p>
  
  <p><strong>user export</strong> </p>
  
  <pre><code>module.exports = (sequelize, Sequelize) =&gt; {
  const User = sequelize.define('users', {
      name: {
          type: Sequelize.STRING
      },
      username: {
          type: Sequelize.STRING
      },
      password: {
          type: Sequelize.STRING
      }
  });
  
  return User;
  </code></pre>
  
  <p>}</p>
  
  <p><strong>and this is the problem</strong> </p>
  
  <blockquote>
    <p>Unhandled rejection SequelizeDatabaseError: <strong>Unknown column 'users.email' in 'where clause'
        at Query.formatError</strong> (C:\Users\Itzik\Desktop\לימודים\projact3\server\node_modules\sequelize\lib\dialects\mysql\query.js:244:16)
        at Query.handler [as onResult] (C:\Users\Itzik\Desktop\לימודים\projact3\server\node_modules\sequelize\lib\dialects\mysql\query.js:51:23)
        at Query.execute (C:\Users\Itzik\Desktop\לימודים\projact3\server\node_modules\mysql2\lib\commands\command.js:30:14)<br>
        at Connection.handlePacket (C:\Users\Itzik\Desktop\לימודים\projact3\server\node_modules\mysql2\lib\connection.js:449:32)
        at PacketParser.Connection.packetParser.p [as onPacket] (C:\Users\Itzik\Desktop\לימודים\projact3\server\node_modules\mysql2\lib\connection.js:72:12)
        at PacketParser.executeStart (C:\Users\Itzik\Desktop\לימודים\projact3\server\node_modules\mysql2\lib\packet_parser.js:75:16)
        at Socket.Connection.stream.on.data (C:\Users\Itzik\Desktop\לימודים\projact3\server\node_modules\mysql2\lib\connection.js:79:25)
        at Socket.emit (events.js:198:13)
        at addChunk (_stream_readable.js:288:12)
        at readableAddChunk (_stream_readable.js:269:11)
        at Socket.Readable.push (_stream_readable.js:224:10)
        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)</p>
  </blockquote>