<?php

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

class CreateOfferFiliereTable extends Migration
{
    public function up()
    {
        Schema::create('offer_filiere', function (Blueprint $table) {
            $table->id();
            $table->foreignId('offer_id')->constrained()->onDelete('cascade');
            $table->foreignId('filiere_id')->constrained()->onDelete('cascade');
            $table->timestamps();

           
            $table->unique(['offer_id', 'filiere_id']);
        });
    }

    public function down()
    {
        Schema::dropIfExists('offer_filiere');
    }
}
