<?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('judicial_precedents', function (Blueprint $table) {
            $table->id();
            $table->string('ruling_number')->unique()->comment('شماره رأی');
            $table->date('ruling_date')->comment('تاریخ صدور');
            $table->string('subject')->comment('موضوع');
            $table->text('full_text')->comment('متن کامل رأی');
            $table->string('issuing_authority')->default('هیأت عمومی دیوان عالی کشور')->comment('مرجع صادر کننده');
            $table->timestamps();
        });
    }

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