<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('route_groups', function (Blueprint $table) {
            $table->id()->comment('主键');
            $table->string('name', 50)->unique()->comment('分组标识');
            $table->string('label', 100)->comment('显示名称');
            $table->text('description')->nullable()->comment('描述');
            $table->integer('sort_order')->default(0)->comment('排序');
            $table->timestampTz('created_at')->useCurrent()->comment('创建时间');
        });
    }

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