title: Sequelize/Postgres - how to update each row individually on migrate?
body: <p>I have lots of records in my postgres. (using sequelize to communicate)</p>
  
  <p>I want to have a migrate script, but due to locking, I have to do each change as atomic as possible. </p>
  
  <p>So I don't want to <code>selectAll</code> and then modify and then <code>saveAll</code>. </p>
  
  <p>In mongo I have <code>forEach</code> cursor which allows me to update a record, save it and only then move to the next one. </p>
  
  <p>Anything similar in sequelize/postgres? </p>
  
  <p>Currently, I am doing that in my code - getting the IDs, then for each performing a query. </p>
  
  <pre><code>return migration.runOnAllUpdates((record)=&gt;{
      record.change = 'new value';
      return record.save()
   });
  </code></pre>
  
  <p>where <code>runOnAllUpdates</code> will simply give me records one by one. </p>