title: Sequelize mySQL to MS SQL migration
body: <p>We're moving from mySQL to MS SQL db and using Sequelize in NodeJS as an api.</p>
  
  <p>Issues start when using the <code>.findOrCreate</code> method. </p>
  
  <p>What I expect when calling an endpoint is that the record that I pass in the body of the request will get created, since it doesnt exist in the db. 
  The ID field in the db is pk and identity(0,1). </p>
  
  <p>Sequelize is trying to insert into that field, how can I prevent that?</p>
  
  <p>This is the code in the route:</p>
  
  <pre><code>model.table1
      .findOrCreate({
        where: {
          id: req.params.id
        },
        defaults: {
          field1: req.body.field1,
          field2: req.body.field2,
          field3: req.body.field3
        }
      })
      .spread((rowFound, created) =&gt; {
        if (created) {
          rowFound.get({ plain: true });
        } else {
          rowFound.update({
            field1: req.body.field1,
          field2: req.body.field2,
          field3: req.body.field3
          });
        }
      })
      .then(result =&gt; {
        res.json(result);
      })
      .catch(error =&gt; {
        console.log('error', error);
        res.status(500).send('Something went wrong');
      });
  </code></pre>
  
  <p>This is the model:</p>
  
  <pre><code>module.exports = sequelize =&gt; {
    const table1 = sequelize.define(
      'table1',
      {
        field1: Sequelize.STRING(10),
        field2: Sequelize.STRING(255),
        field3: Sequelize.STRING(300),
        id: { type: Sequelize.INTEGER, primaryKey: true },
      },
      {
        schema: 'dbo',
        tableName: 'table1',
        hasTrigger: true
      }
    );
  
    return table1;
  };
  </code></pre>