title: Dropping column with foreign key Laravel error: General error: 1025 Error on rename
body: <p>I've created a table using migration like this:</p>
  
  <pre><code>public function up()
  {
      Schema::create('despatch_discrepancies',  function($table) {
          $table-&gt;increments('id')-&gt;unsigned();
          $table-&gt;integer('pick_id')-&gt;unsigned();
          $table-&gt;foreign('pick_id')-&gt;references('id')-&gt;on('picks');
          $table-&gt;integer('pick_detail_id')-&gt;unsigned();
          $table-&gt;foreign('pick_detail_id')-&gt;references('id')-&gt;on('pick_details');
          $table-&gt;integer('original_qty')-&gt;unsigned();
          $table-&gt;integer('shipped_qty')-&gt;unsigned();
      });
  }
  
  public function down()
  {
      Schema::drop('despatch_discrepancies');
  }
  </code></pre>
  
  <p>I need to change this table and drop the foreign key reference &amp; column <code>pick_detail_id</code> and add a new varchar column called <code>sku</code> after <code>pick_id</code> column.</p>
  
  <p>So, I've created another migration, which looks like this:</p>
  
  <pre><code>public function up()
  {
      Schema::table('despatch_discrepancies', function($table)
      {
          $table-&gt;dropForeign('pick_detail_id');
          $table-&gt;dropColumn('pick_detail_id');
          $table-&gt;string('sku', 20)-&gt;after('pick_id');
      });
  }
  
  public function down()
  {
      Schema::table('despatch_discrepancies', function($table)
      {
          $table-&gt;integer('pick_detail_id')-&gt;unsigned();
          $table-&gt;foreign('pick_detail_id')-&gt;references('id')-&gt;on('pick_details');
          $table-&gt;dropColumn('sku');
      });
  }
  </code></pre>
  
  <p>When I run this migration, I get the following error:</p>
  
  <blockquote>
    <p>[Illuminate\Database\QueryException]<br>
    SQLSTATE[HY000]: General error: 1025 Error on rename of
    './dev_iwms_reboot/despatch_discrepancies' to
    './dev_iwms_reboot/#sql2-67c-17c464' (errno: 152) (SQL: alter table
    <code>despatch_discrepancies</code> drop foreign key pick_detail_id)</p>
    
    <p>[PDOException]<br>
    SQLSTATE[HY000]: General error: 1025 Error on rename of
    './dev_iwms_reboot/despatch_discrepancies' to
    './dev_iwms_reboot/#sql2-67c-17c464' (errno: 152)</p>
  </blockquote>
  
  <p>When I try to reverse this migration by running <code>php artisan migrate:rollback</code> command, I get a <code>Rolled back</code> message, but it's not actually doing anything in the database.</p>
  
  <p>Any idea what might be wrong? How do you drop a column that has a foreign key reference?</p>