<?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('assessments', function (Blueprint $table) {
            $table->id();
            $table->foreignId('training_class_id')->constrained('training_classes')->cascadeOnDelete();
            $table->string('title');
            $table->string('type')->default('Bài kiểm tra');
            $table->date('assessment_date')->nullable();
            $table->decimal('max_score', 5, 2)->default(10);
            $table->decimal('pass_score', 5, 2)->default(5);
            $table->string('status')->default('Dự kiến');
            $table->text('note')->nullable();
            $table->timestamps();
        });
    }
    public function down(): void { Schema::dropIfExists('assessments'); }
};
