<?php

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

/**
 * When the operator first finishes or skips the onboarding tour we stamp this; a null value means the
 * tour has never been dismissed, so it auto-opens once on the first panel load. It can always be
 * relaunched from Settings (that does NOT clear the stamp — the relaunch is a client-side event).
 */
return new class extends Migration
{
    public function up(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->timestamp('onboarding_tour_completed_at')->nullable()->after('must_change_password');
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('onboarding_tour_completed_at');
        });
    }
};
