title: Laravel migration will not add foreign key
body: <p>I am new to migrations and attempting to create 2 tables with a foreign key in one referencing an id in the other but I am getting a general failure to add key error. is there something I am missing?</p>
  
  <p>error:</p>
  
  <p><code>[PDOException]
    SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint</code></p>
  
  <p>code:</p>
  
  <pre><code>    Schema::create('app_groups', function($table) {
       $table-&gt;increments('id');
       $table-&gt;string('app_name');
       $table-&gt;unsignedInteger('app_group_id');
       $table-&gt;timestamps();
    });
  
    Schema::create('app_to_bucket', function($table) {
       $table-&gt;increments('id');
       $table-&gt;unsignedInteger('app_group_id');
       $table-&gt;unsignedInteger('bucket_id');
       $table-&gt;timestamps();
    });
    Schema::table('app_to_bucket', function($table) {
       $table-&gt;foreign('app_group_id')-&gt;references('app_group_id')-&gt;on('app_groups')-&gt;onDelete('cascade');
    });
  </code></pre>