<?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('hadees', function (Blueprint $table) {
            $table->id();
            $table->foreignId('hadith_category_id')->constrained('hadith_categories')->onDelete('cascade');
            $table->string('topic'); // English topic
            $table->string('topic_arabic'); // Arabic topic
            $table->text('narrator'); // English narration (e.g., "Umar ibn al-Khattab reported...")
            $table->text('arabic_text'); // Full Arabic text of Hadith
            $table->text('english_translation'); // English translation/explanation
            $table->string('source'); // e.g., "Şahih al-Bukhārī 54"
            $table->string('grade')->nullable(); // e.g., "Muttafaqun Alayhi"
            $table->timestamps();
            
            $table->index('hadith_category_id');
        });
    }

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