<?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('kr_test_accounts', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('game_id')->index()->comment('游戏ID');
            $table->string('name', 32)->comment('测试账号名称');
            $table->string('id_card', 18)->comment('身份证号（加密存储）');
            $table->string('id_card_masked', 18)->comment('身份证号（脱敏显示）');
            $table->tinyInteger('age_group')->index()->comment('年龄段: 0=未满8 1=8-16 2=16-18 3=已满18');
            $table->string('phone', 11)->comment('测试手机号');
            $table->string('password_hint', 32)->comment('密码提示');
            $table->tinyInteger('status')->default(1)->comment('1=启用 0=禁用');
            $table->unique(['game_id', 'age_group']);
            $table->timestamps();
        });
    }

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