<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->boolean('is_on_vacation')->default(false)->after('is_admin');
            $table->text('vacation_message')->nullable()->after('is_on_vacation');
            $table->timestamp('vacation_start_date')->nullable()->after('vacation_message');
            $table->timestamp('vacation_end_date')->nullable()->after('vacation_start_date');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn(['is_on_vacation', 'vacation_message', 'vacation_start_date', 'vacation_end_date']);
        });
    }
};
