<?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('ratings', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('from_user_id'); // Foreign key to user_profiles
            $table->unsignedBigInteger('to_user_id'); // Foreign key to courses
            $table->unsignedBigInteger('course_id'); // Foreign key to courses
            $table->tinyInteger('score'); // Rating value (1-5)
            $table->text('comment')->nullable(); // Optional comment about the rating
            $table->timestamps();
        });
    }

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