Changing column in Laravel migration causes exception: Changing columns for table requires Doctrine DBAL

Ahmad picture Ahmad · Apr 21, 2016 · Viewed 21.3k times · Source

I'm trying to change the max length of one of my columns in table reserves in one migration. The code looks like this:

public function up()
{
    //
    Schema::table('reserves', function($table){
        $table->string("mobile", 11)->change();
    });
}

But when running the migration via artisan, it throws an exception and says:

[RuntimeException] Changing columns for table "reserves" requires Doctrine DBAL; install "doctrine/dbal".

What is the problem and how can I solve it?

Answer

Ahmad picture Ahmad · Apr 21, 2016

The problem was solved by executing the following command on the root directory of the framework:

composer require doctrine/dbal