<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Creates the configs table used to store database-driven key/value configuration.
     */
    public function up(): void
    {
        Schema::create('configs', function (Blueprint $table) {
            $table->string('key')->primary();
            $table->json('json_value')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Drops the configs table on rollback.
     */
    public function down(): void
    {
        Schema::dropIfExists('configs');
    }
};
