<?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('disctinct_moyennes', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('rang');
            $table->string('moyenne');
            $table->enum('mension',[1, 2, 3]);
            $table->unsignedBigInteger('school_id');
            $table->unsignedBigInteger('inscription_id');
            $table->unsignedBigInteger('cutting_school_year_id');
            $table->foreign('school_id')->references('id')->on('schools')->onDelete('cascade');
            $table->foreign('inscription_id')->references('id')->on('inscriptions')->onDelete('cascade');
            $table->foreign('cutting_school_year_id')->references('id')->on('cutting_school_year')->onDelete('cascade');
            $table->timestamps();
        });
    }

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