<?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()
    {
        Schema::create('conx_users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('first_name', 50);
            $table->string('last_name', 50);
            $table->string('password');
            $table->string('email_address')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->enum('is_active', ['true', 'false']);
            $table->enum('role', ['Superadmin', 'Admin']);
            $table->string('phone_num', 50)->nullable();
            $table->enum('enable_2fa', ['true', 'false'])->default('false');
            $table->string('email_code' , 6)->nullable();
            $table->string('mobile_code' , 6)->nullable();
            $table->timestamp('blocked_expiration')->nullable();
            $table->string('new_email_address')->unique()->nullable();
            $table->timestamp('mobile_code_expiration')->nullable();
            $table->string('email_verification_code')->nullable();
            $table->binary('profile_picture')->nullable();
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('conx_users');
    }
};
