Node Knex insert not executing
<p>I'm executing this knee query in node:</p>

<pre><code>return Knex.transaction(function (tx) {
        debug("Inserting new story record");
        return tx.insert({
            'projectId':projectId,
            'title': title,
            'story': text,
            'points': 0,
            'storyNumber': Knex('story').max('storyNumber').where('projectId', projectId)
        }, 'id')
            .into('story')
            .then(function (id) {
                debug("Returning story for %s", id);
                return getStory(id);
            })
    })
</code></pre>

<p>But the 'then()' function is never called. Anyone know why?</p>

<p>I've been reading all the knex doco and it appears that I've done everything right. The debug for the command looked like this:</p>

<pre><code>crux:db Inserting new story record +4ms
{ method: 'insert',
  options: {},
  timeout: false,
  cancelOnTimeout: false,
  bindings: [ 0, 2, 'test', 2, 'title' ],
  __knexQueryUid: 'aa5ff1d3-eff0-4687-864b-772c26e1aebd',
  sql: 'insert into `story` (`points`, `projectId`, `story`, `storyNumber`, `title`) values (?, ?, ?, (select max(`storyNumber`) from `story` where `projectId` = ?), ?)' }
</code></pre>

<p>So it all looks good to me. Just never executes.</p>