<?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('kylin_settings', function (Blueprint $table) {
            $table->id();
            $table->string('group', 50)->default('default')->comment('分组');
            $table->string('key', 100)->comment('键');
            $table->text('value')->nullable()->comment('值');
            $table->string('type', 20)->default('string')->comment('类型:string,int,bool,json');
            $table->string('description', 255)->nullable()->comment('描述');
            $table->timestamps();
            $table->softDeletes();
            $table->unique(['group', 'key']);
        });
    }

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