<?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('art_legal_opinion', function (Blueprint $table) {
            $table->id();
            $table->foreignId('art_id')->constrained('art')->onDelete('cascade');
            $table->foreignId('legal_opinion_id')->constrained('legal_opinions')->onDelete('cascade');
            $table->timestamps();

            $table->unique(['art_id', 'legal_opinion_id']);
        });
    }

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