File: //home/armgroup/libs/database/migrations/2022_07_24_102510_create_organization_product_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateOrganizationProductTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('organization_product', function (Blueprint $table) {
$table->foreignId('organization_id')->nullable()->constrained('organizations')->onUpdate('cascade')->onDelete('cascade');
$table->foreignId('product_id')->constrained('products')->onUpdate('cascade')->onDelete('cascade');
$table->unsignedBigInteger('special')->nullable();
$table->dateTime('special_started_at')->nullable();
$table->dateTime('special_ended_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('organization_product');
}
}