Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 1075表格定义不正确;只能有一个自动列,不能将其定义为键_Php_Laravel_Laravel 5 - Fatal编程技术网

Php Laravel 1075表格定义不正确;只能有一个自动列,不能将其定义为键

Php Laravel 1075表格定义不正确;只能有一个自动列,不能将其定义为键,php,laravel,laravel-5,Php,Laravel,Laravel 5,当我尝试在laravel中迁移此表时 命令输出为: [PDOException]SQLSTATE[42000]:语法错误或访问冲突:1075 表定义不正确;只能有一个自动列,并且它 必须定义为密钥 不要为bigInteger列指定大小 $table->bigInteger('post_author'); 不要为bigInteger列指定大小 $table->bigInteger('post_author'); 通过以下方式指定bigInteger列的大小 $table->b

当我尝试在laravel中迁移此表时

命令输出为:

[PDOException]SQLSTATE[42000]:语法错误或访问冲突:1075 表定义不正确;只能有一个自动列,并且它 必须定义为密钥


不要为bigInteger列指定大小

$table->bigInteger('post_author');

不要为bigInteger列指定大小

$table->bigInteger('post_author');

通过以下方式指定bigInteger列的大小

$table->bigInteger('post_author')->length(20);

通过以下方式指定bigInteger列的大小

$table->bigInteger('post_author')->length(20);

如何在自动增量字段中添加此项?如何在自动增量字段中添加此项?@AnwarulIslam请接受anwser并重击我将接受。但现在我不允许竖起大拇指。“我正试图给予,但我需要一些声誉来做到这一点。”安瓦鲁利斯兰请接受安瑟尔和砰砰的一声,我会接受的。但现在我不允许竖起大拇指。我试图给予,但我需要一些声誉来做到这一点。