title: Knex : When migration fails tables are still created
body: <p>For any reason some migration might fail at some point. I was under the impression that migrations are wrapped in transactions in knex however to my dismay i realised that even though the migration has failed, the tables that were created before the error still persist in the DB.</p>
  
  <p>An example migration would look like this:</p>
  
  <pre><code>exports.up = function (knex) {
      return knex.schema
          .createTable('someTable', function (table) {
              table.increments('id');
              table.string('something').notNullable();
          //throws error here for whatever reason, maybe an invalid default value
          })
          .createTable('another table', function (table) {
              table.increments('id');
              table.string('other').notNullable();
          })
  
  };
  
  exports.down = function (knex) {
      return knex.schema
          .dropTable("chatGroups")
          .dropTable("chatMessages");
  };
  </code></pre>
  
  <p>Even though the error is thrown when creating <strong>someTable</strong> nothing rolls back and all changes are commited to the DB. Running the migration subsequently is now not possible. Even worse, it is not registered in knex_migrations and i cannot even rollback so i have to delete the table manually.</p>
  
  <p>Am i missing something? I would like things to happen atomically, how can i achieve that?</p>
  
  <p>Thank you so much</p>