为修改列长和类型,我运行了以下命令
我的列名是course_slot_id
有int(11)
,我想更改它varchar(100)
- composer require doctrine/dbal
- php artisan make:migration modify_course_slot_id_table --table=course_booking
- php artisan migrate
我的迁移
class ModifyCourseSlotIdTable extends Migration
{
public function up()
{
Schema::table('course_booking', function (Blueprint $table) {
$table->string('course_slot_id', 100)->nullable()->change();
});
}
public function down()
{
Schema::table('course_booking', function (Blueprint $table) {
//...
});
}
}
运行迁移命令时遇到以下问题
In AbstractPlatform.php line 434:
Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.