<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up(): void {
        Schema::dropIfExists('evaluacion_plantel');
        Schema::create('evaluacion_plantel', function (Blueprint $table) {
            $table->unsignedBigInteger('evaluacion_id');
            $table->unsignedBigInteger('plantel_id');
            $table->primary(['evaluacion_id', 'plantel_id']);
            $table->foreign('evaluacion_id')->references('id')->on('evaluaciones')->onDelete('cascade');
            $table->foreign('plantel_id')->references('id')->on('plantels');
        });
    }
    public function down(): void { Schema::dropIfExists('evaluacion_plantel'); }
};
