title: Using Async/Await with Knex migrations
body: <p>I am using Knex migrations with regular promise methods, like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>exports.up = function (knex) {
      return knex.schema
          .hasTable('table_name')
          .then(function (exists) {
              if (!exists) {
                  return knex
                      .schema
                      .createTable('table_name', function (table) {
                          table.increments('id').primary();
                      })
                      .then(console.log('created table_nametable'));
              }
          });
  };
  </code></pre>
  
  <p>How would I refactor this to use async/await? The overall structure, where we are returning knex.schema with a chain of promise methods is throwing me for a loop.</p>