<?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('perioade', function (Blueprint $table) {
            $table->id();
            $table->foreignId('clasa_id')->constrained('clase')->onDelete('cascade');
            $table->string('nume'); // ex: "Semestrul I", "Trimestrul 1", "Modulul 2"
            $table->integer('ordine'); // 1, 2, 3...
            $table->date('data_inceput');
            $table->date('data_sfarsit');
            $table->boolean('activa')->default(false);
            $table->timestamps();
        });
    }

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