title: how to re-index (number) sorted sqlite table
body: <p>for example I've got nodes with indexes</p>
  
  <pre><code>1
  2
  7
  8
  </code></pre>
  
  <p>I need to change indexes to</p>
  
  <pre><code>1 
  2 
  3 
  4
  </code></pre>
  
  <p>I can </p>
  
  <pre><code>UPDATE TODO SET id = id + 1000000000
  UPDATE TODO SET id = id - (1000000000 + 1)
  </code></pre>
  
  <p>(tricky because id must be unique)</p>
  
  <p>to shift all the indexes and make 0 1 6 7 but I need to make relation, need to make first index shift to 0, and other index shift to previous index. There is no stored procedures in sqlite so I'm confised about How can I make such relation without variables? </p>
  
  <p>every logics tips are welcome.</p>