laravel5.7のマイグレーションファイルにて、主キーuser_idを追加したいです。
下記のようなup()関数にしました。
public function up() { Schema::create('voice', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id'); $table->unsignedInteger('genkyo'); $table->unsignedInteger('building'); $table->unsignedInteger('own'); $table->string('address'); $table->unsignedInteger('size'); $table->unsignedInteger('unit'); $table->unsignedInteger('construction_year'); $table->unsignedInteger('construction_month'); $table->rememberToken(); $table->timestamps(); $table->primary(['id','user_id']); }); }
エラーメッセージが下記の通り表示され実現できません。
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined (SQL: alter table voice
add primary key voice_id_user_id_primary
(id
, user_id
))
ご教示のほど、何卒宜しくお願いいたします。

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。