title: Use one Laravel migrations table per database
body: <p>I work in a project that uses multiple databases. It seems like Laravel only uses the migrations-table in the database that is set as default. I would like one migrations table per database that logs the migrations that have been done to that specific database. Is this possible?</p>
  
  <p>I have defined the databases in the config like this:</p>
  
  <pre><code>'connections' =&gt; [
      'db1' =&gt; array(
          'driver'    =&gt; 'mysql',
          'host'      =&gt; 'db1.host',
          'database'  =&gt; 'db1',
          'username'  =&gt; 'username',
          'password'  =&gt; 'password',
      ),
      'db2' =&gt; [
          'driver'    =&gt; 'mysql',
          'host'      =&gt; 'db2.host',
          'database'  =&gt; 'db2',
          'username'  =&gt; 'username',
          'password'  =&gt; 'password',
      ]
  ],
  </code></pre>
  
  <p>I also made the first database (db1) the default one</p>
  
  <pre><code>'default' =&gt; 'db1'
  </code></pre>
  
  <p>I install the migrations table on both databases</p>
  
  <pre><code>artisan migrate:install --database=db1
  artisan migrate:install --database=db2
  </code></pre>
  
  <p>After that i proceed to create a couple of database specifc migrations</p>
  
  <p>Create table test1 in db1 database:</p>
  
  <pre><code>use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateTest1Table extends Migration
  {
      public function up()
      {
          Schema::connection('db1')-&gt;create('test1', function(Blueprint $table)
          {
              $table-&gt;increments('id')-&gt;unsigned();
          });
      }
  
      public function down()
      {
          Schema::connection('db1')-&gt;drop('test1');
      }
  }
  </code></pre>
  
  <p>Create table test2 in db2 database:</p>
  
  <pre><code>use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateTest2Table extends Migration
  {
      public function up()
      {
          Schema::connection('db2')-&gt;create('test2', function(Blueprint $table)
          {
              $table-&gt;increments('id')-&gt;unsigned();
          });
      }
  
      public function down()
      {
          Schema::connection('db2')-&gt;drop('test2');
      }
  }
  </code></pre>
  
  <p>I now run the migrations</p>
  
  <pre><code>artisan migrate
  </code></pre>
  
  <h2>Expected outcome</h2>
  
  <h3>db1.migrations</h3>
  
  <pre><code>+-----------------------------+-------+
  | migration                   | batch |
  +-----------------------------+-------+
  | create_test1_table_in_db1   |     1 |
  +-----------------------------+-------+
  </code></pre>
  
  <h3>db2.migrations</h3>
  
  <pre><code>+-----------------------------+-------+
  | migration                   | batch |
  +-----------------------------+-------+
  | create_test2_table_in_db2   |     1 |
  +-----------------------------+-------+
  </code></pre>
  
  <h2>Actual outcome</h2>
  
  <h3>db1.migrations</h3>
  
  <pre><code>+-----------------------------+-------+
  | migration                   | batch |
  +-----------------------------+-------+
  | create_test1_table_in_db1   |     1 |
  | create_test2_table_in_db2   |     1 |
  +-----------------------------+-------+
  </code></pre>
  
  <h3>db2.migrations</h3>
  
  <pre><code>+-----------------------------+-------+
  | migration                   | batch |
  +-----------------------------+-------+
  Empty set
  </code></pre>