<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('property_facilities', function (Blueprint $table) {
            $table->id();
            
            $table->unsignedBigInteger('id_prop');
            $table->foreign('id_prop')->references('id')->on('properties')->onDelete('cascade');
            // $table->foreign('id_prop')->references('id')->on('facilities')->onDelete('cascade');

            $table->unsignedBigInteger('id_facil');
            $table->foreign('id_facil')->references('id')->on('facilities')->onDelete('cascade');

            $table->timestamps();
            // $table->softDeletes();
        });
    }

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