<?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::table('users', function (Blueprint $table) {
            if (!Schema::hasColumn('users', 'email_verification_code')) {
                if (!Schema::hasColumn('users', 'email_verification_code')) { $table->string('email_verification_code', 6)->nullable(); }
            }
            if (!Schema::hasColumn('users', 'verification_code_sent_at')) {
                if (!Schema::hasColumn('users', 'verification_code_sent_at')) { $table->timestamp('verification_code_sent_at')->nullable(); }
            }
        });
    }

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


