My foreign key relates to its own table. This was to produce posts with hierarchy.
Now when I try and drop the column in the database, it gives me this error:
1553 - Cannot drop index 'post_field_properties_parent_id_index': needed in a foreign key constraint
This is the code:
public function down()
{
Schema::table( "post_field_properties", function( $table )
{
$table->dropForeign('parent_id');
$table->dropColumn('parent_id');
} );
}
The only way I seem to be able to do it, is to goto phpmyadmin and remove the foreign key itself. and then drop the column.