<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreatePlansCoverageCountriesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('plans_coverage_countries', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('country_id'); $table->unsignedBigInteger('plan_id'); $table->timestamps(); $table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade'); $table->foreign('plan_id')->references('id')->on('plans')->onDelete('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('plans_coverage_countries'); } }