<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements("id");
            $table->string('name');
            $table->string('email')->nullable();
            $table->string('username')->nullable();
            $table->enum('gender', ["L", "P"])->nullable();
            $table->string('phone')->nullable();
            $table->string('pekerjaan')->nullable();
            $table->text('address')->nullable();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password');
            $table->string('foto_profil')->nullable();
            $table->dateTime('last_login')->nullable();
            $table->enum('is_active', ["Y", "N", "B"])->default("N")->comment('Y = Sudah diaktivasi, N = Belum Diaktivasi, B = Pengguna di blok');
            $table->enum('is_read', [1, 0])->default(0)->comment('Notifikasi user baru untuk admin');

            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
        });
    }

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