I issued the command:
php artisan generate:scaffold order --fields="customer_id:integer(11), order_date:date, notes:text”
When it gets to migrate, it ends with the error:
General error: 1 table "orders" has more than one primary key (SQL: create table "orders" ("id" integer not null primary key autoincrement, "customer_id" integer not null primary key autoincrement, "order_date" date not null, "notes" text not null))
There is a Customer model and corresponding table that I am trying to reference with customer_id in the schema. However, it shouldn't be the primary key for the orders table.
Here is the up() code that is preventing migration from running:
Schema::create('orders', function(Blueprint $table)
{
$table->increments('id');
$table->integer('customer_id', 11);
$table->date('order_date');
$table->text('notes');
$table->timestamps();
});
How do I get this to work?