<?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('kp_prompts', function (Blueprint $table) {
            $table->id();
            $table->tinyInteger('age_group')->index()->comment('年龄段: 0=未满8 1=8-16 2=16-18 3=已满18');
            $table->string('scene', 64)->index()->comment('场景: login/time_limit/duration_warning/payment_limit/kick/health_advice/guardian_bind/face_verify/report_channel');
            $table->string('title', 128)->comment('提示标题');
            $table->text('content')->comment('提示内容');
            $table->string('popup_type', 16)->default('modal')->comment('弹窗类型: modal/toast/banner');
            $table->tinyInteger('status')->default(1)->comment('1=启用 0=禁用');
            $table->unique(['age_group', 'scene']);
            $table->timestamps();
        });
    }

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