Php 使用laravel迁移更改列类型使用DBAL给出错误
我使用Laravel5.2、Php7、Apache和Windows 我的迁移文件是“2016\u 03\u 30\u 095234\u alter\u date\u update\u news\u table.php”Php 使用laravel迁移更改列类型使用DBAL给出错误,php,doctrine-orm,laravel-5,migration,Php,Doctrine Orm,Laravel 5,Migration,我使用Laravel5.2、Php7、Apache和Windows 我的迁移文件是“2016\u 03\u 30\u 095234\u alter\u date\u update\u news\u table.php” 但在运行之后 $\>php artisan迁移 给我这个错误 [RuntimeException]更改表“news”的列需要 DBAL原则;安装“条令/dbal” 我该怎么办?似乎您缺少依赖项 /** * Run the migrations. * php artisan
但在运行之后
$\>php artisan迁移
给我这个错误
[RuntimeException]更改表“news”的列需要
DBAL原则;安装“条令/dbal”
我该怎么办?似乎您缺少依赖项
/**
* Run the migrations.
* php artisan make:migration alter_date_update_news_table
* @return void
*/
public function up()
{
Schema::table('news', function (Blueprint $table) {
$table->dropColumn('date');
});
Schema::table('news', function (Blueprint $table) {
$table->date('date')->after('image');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('news', function (Blueprint $table) {
$table->dropColumn('date');
});
Schema::table('news', function (Blueprint $table) {
$table->dateTime('date')->after('image');
});
}
使用composer安装它:
composer require doctrine/dbal
据拉威尔说。如果使用的是->change()
函数,则必须首先安装doctor/dbal
在终端中键入编写器/dbal
composer require doctrine/dbal