title: How to use sequelize findorcreate in bulk import?
body: <p>I'm trying to use the <code>findOrCreate</code> function in a CSV import to prevent multiple users being created with the same email address but it isn't working.</p>
  
  <p>I import all the rows in a CSV file into memory:</p>
  
  <pre><code>importableCsvRows.forEach(row =&gt; importData(row))
  </code></pre>
  
  <p>Then I iterate over each row to import a user:</p>
  
  <pre><code>function importData (row) {
    const name = row[0]
    const email = row[1]
    addUser(name, email)
  }
  </code></pre>
  
  <p>In the addUser function I use findOrCreate:</p>
  
  <pre><code>function addUser (name, email) {
    return new Promise(function (resolve, reject) {
      const user = models.users.findOrCreate({
        where: {email: email},
        defaults: { email: email, name: name }
      })
      .then(u =&gt; {
        return resolve(u)
      })
      .catch(err =&gt; {
        console.log('ERROR', err)
        return reject(err)
      })
    })
  }
  </code></pre>
  
  <p>The problem is that multiple transactions get started because findOrCreate is async so before the first row finishes processing, the next row starts.</p>