<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAccommodationEquipmentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('accommodation_equipment', function (Blueprint $table) {
            $table->integer('accommodation_id')->unsigned()->nullable();
            $table->foreign('accommodation_id')->references('accommodation_id')->on('accommodations')->onDetele('cascade');

            $table->integer('equipment_id')->unsigned()->nullable();
            $table->foreign('equipment_id')->references('equipment_id')->on('equipment')->onDetele('cascade');


        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('accommodation_equipments');
    }
}
