<?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('website_testimonials', function (Blueprint $table) {
            $table->id();
            $table->uuid('uuid')->unique();
            $table->foreignId('academy_id')->constrained('academies');
            $table->string('name');
            $table->string('name_en')->nullable();
            $table->string('role')->nullable();
            $table->string('role_en')->nullable();
            $table->text('content');
            $table->text('content_en')->nullable();
            $table->unsignedTinyInteger('rating')->default(5);
            $table->boolean('is_featured')->default(false);
            $table->unsignedSmallInteger('sort_order')->default(0);
            $table->timestamps();
            $table->softDeletes();

            $table->index(['academy_id', 'is_featured']);
        });
    }

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