for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateOrderProducts extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create('product_order', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('order_id');
$table->unsignedBigInteger('product_item_id');
$table->integer('number_products');
$table->timestamps();
//fk
$table->foreign('order_id')->references('id')->on('orders');
$table->foreign('product_item_id')->references('id')->on('product_items');
});
}
* Reverse the migrations.
public function down()
Schema::dropIfExists('product_order');