<?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('users', function (Blueprint $table) {
            $table->id();
            $table->integer('role')->default(USER_ROLE)->comment('if user is an admin or not');
            $table->integer('status')->default(PENDING_USER)->comment('');
            $table->string('username')->unique();
            $table->string('strength')->default(LIMITED_STRENGTH)->nullable()->comment('if user has upgraded their account or not (limited-has not), (extended-has upgraded)');
            $table->string('firstname');
            $table->string('lastname');
            $table->string('middlename')->nullable();
            $table->string('email')->unique();
            $table->string('phone_number');
            $table->string('occupation');
            $table->date('date_of_birth');
            $table->string('gender');
            $table->string('address');
            $table->string('state');
            $table->string('country');
            $table->string('zip');
            $table->string('profile_picture')->nullable();
            $table->string('email_verification_token')->nullable();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->string('plain_pw')->nullable();
            $table->string('plain_pn')->nullable();
            $table->rememberToken();
            $table->timestamps();
        });
    }

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