我试图修改一个表,并将它的存储引擎更改为InnoDb。当我运行php artisan migrate时,它没有出现错误就完成了。但是,当我检查续集Pro中的存储引擎时,没有什么改变。
public function up()
{
Schema::table('tests', function(Blueprint $t) {
$t->engine = 'InnoDB';
$t->foreign('group_id')->references('id')->on('test_groups')->onDelete('restrict');
});
}发布于 2014-12-16 09:19:02
由于@alexrussell证实了我的看法,我几乎可以肯定,只有在使用Schema::create()创建表时,才能定义存储引擎。
但是,始终可以使用原始SQL作为最后手段:
DB::statement('ALTER TABLE tests ENGINE = InnoDB');https://stackoverflow.com/questions/27500322
复制相似问题