<?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('kh_holidays', function (Blueprint $table) {
            $table->id();
            $table->date('date')->unique()->comment('日期');
            $table->string('name', 64)->comment('节假日名称');
            $table->tinyInteger('is_holiday')->default(1)->comment('1=节假日 0=调休上班');
            $table->timestamps();
            $table->index('is_holiday');
        });
    }

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