<?php

use App\Database\Blueprint;
use App\Enums\DbStatusFieldEnum;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('system_parameters', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('name_display');
            $table->string('data_type');
            $table->boolean('canSee')->default(true);
            $table->string('note')->nullable(); // megjegyezes
            $table->json('stored_data');
            $table->enum('status', DbStatusFieldEnum::getValues())->default(DbStatusFieldEnum::draft);
            $table->timestamps();
            $table->userIdFields();
        });
    }

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