<?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('animateur_visits', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('qualite');
            $table->string('time');
            $table->string('date');
            $table->integer('order');
            $table->unsignedBigInteger('user_id'); 
            $table->unsignedBigInteger('classe_id'); 
            $table->unsignedBigInteger('school_matter_id');
            $table->unsignedBigInteger('report_quarter_id');
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->foreign('classe_id')->references('id')->on('classes')->onDelete('cascade');
            $table->foreign('school_matter_id')->references('id')->on('school_matter')->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('animateur_visits');
    }
};
