<?php

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

return new class extends Migration {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasColumn('user_email_limits', 'resume_access')) {
            Schema::table('user_email_limits', function (Blueprint $table) {
                $table->boolean('resume_access')->default(0);
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if (!Schema::hasColumn('user_email_limits', 'resume_access')) {
            Schema::table('user_email_limits', function (Blueprint $table) {
                $table->dropColumn('resume_access');
            });
        }
    }
};
