<?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('abandons', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('order');
            $table->longText('motif');
            $table->unsignedBigInteger('classe_id');
            $table->unsignedBigInteger('inscription_id');
            $table->unsignedBigInteger('report_quarter_id');
            $table->foreign('classe_id')->references('id')->on('classes')->onDelete('cascade');
            $table->foreign('inscription_id')->references('id')->on('inscriptions')->onDelete('cascade');
            $table->foreign('report_quarter_id')->references('id')->on('report_quarters')->onDelete('cascade');
            $table->timestamps();
        });
    }

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