<?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::create('transferuri', function (Blueprint $table) {
            $table->id();
            $table->foreignId('elev_id')->constrained('elevi')->onDelete('cascade');
            $table->string('tip'); // intrare, iesire
            $table->foreignId('clasa_veche_id')->nullable()->constrained('clase');
            $table->foreignId('clasa_noua_id')->nullable()->constrained('clase');
            $table->string('scoala_origine')->nullable();
            $table->string('scoala_destinatie')->nullable();
            $table->date('data_transfer');
            $table->string('numar_document')->nullable();
            $table->text('observatii')->nullable();
            $table->foreignId('inregistrat_de')->constrained('users');
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('transferuri');
    }
};
