<?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_holidays', function (Blueprint $table) {
            $table->id();
            $table->unsignedSmallInteger('year')->comment('年份');
            $table->string('name', 50)->comment('节假日名称');
            $table->json('dates')->comment('节假日日期列表');
            $table->string('country', 5)->default('CN')->comment('国家代码');
            $table->timestamps();
            $table->softDeletes();

            $table->index(['year', 'country']);
        });
    }

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