我想将 Laravel 中的一些表列从可为空更改为具有默认值。我安装了学说/dbal,并创建了一个新的迁移,其中包含我想要更改的以下列(以前可以为空):
public function up()
{
Schema::table('movies', function (Blueprint $table) {
$table->string('movieDirector')->default('')->change();
$table->string('movieGenre')->default('')->change();
$table->string('movieCast')->default('')->change();
});
}
然而,这似乎并没有做任何事情。有可能吗?谢谢!