我的遷移看起來像這樣試圖向表中遷移
Schema::create('reports', function (Blueprint $table) {
$table->bigincrements('id');
$table->json('options');
});
我得到這個錯誤:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;
check the manual that corresponds to your MariaDB server version for the right syntax to use near 'json not null) default character set utf8 collate utf8_unicode_ci' at line 1
如果我刪除$table->json('options');
沒有錯誤。
Laravel 5.3文檔提到這個https://laravel.com/docs/5.3/migrations所以我沒有做錯任何想法,爲什麼我得到這個錯誤?
我正在使用MariaDB版本10.1.16,它支持json類型。