環境
FW : Laravel v5.4.33
DB : SQLite
実現したいこと
Laravelで複数のPrimaryKeyを設定したいと思っています。
現在の記述
php
1 public function up() 2 { 3 Schema::create('example', function (Blueprint $table) { 4 $table->increments('id'); 5 6 $table->integer('a')->comment('example_a'); 7 $table->string('b')->comment('example_b'); 8 $table->string('c')->comment('example_c'); 9 10 $table->primary(['id', 'a']); 11 $table->unique(['a', 'b', 'c']); 12 13 $table->timestamps(); 14 }); 15 }
エラーメッセージ
console
1 [PDOException] 2 SQLSTATE[HY000]: General error: 1 table "example" has more than one primary key
お願い
どうすればこのエラーを解決できるのか、お分かりになる方、ご教授をお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/12/14 10:29