<?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('system_updates', function (Blueprint $table) {
            $table->id();
            $table->string('version')->unique();
            $table->date('release_date');
            $table->text('description')->nullable();
            $table->json('features')->nullable();
            $table->json('bug_fixes')->nullable();
            $table->boolean('is_active')->default(true);
            $table->boolean('is_latest')->default(false);
            $table->json('changelog')->nullable();
            $table->string('download_url')->nullable();
            $table->string('checksum')->nullable();
            $table->string('php_required')->nullable();
            $table->timestamp('installed_at')->nullable();
            $table->unsignedBigInteger('installed_by')->nullable();
            $table->timestamps();
        });
    }

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