<?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('installed_modules', function (Blueprint $table) {
            $table->uuid('id')->primary();
            $table->uuid('module_uuid');
            $table->string('name');
            $table->string('version');
            $table->string('status')->default('installed');
            $table->timestamp('installed_at');
            $table->timestamps();

            $table->unique('module_uuid');
        });
    }

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