<?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->string('uid');
            $table->string('user_code', 50)->unique()->nullable(); 
            $table->string('username', 50)->nullable(); 
            $table->string('password'); 
            $table->string('first_name', 100)->nullable(); 
            $table->string('last_name', 100)->nullable(); 
            $table->string('email')->unique(); 
            $table->timestamp('email_verified_at')->nullable();
            $table->string('phone', 20)->nullable(); 
            $table->boolean('is_approved')->default(false); 
            $table->timestamp('approved_at')->nullable(); 
            $table->string('status_login', 50)->nullable(); 
            $table->timestamp('last_login_at')->nullable(); 
            $table->string('activity')->nullable(); 
            $table->timestamp('activity_time')->nullable(); 
            $table->string('payment_username', 50)->nullable(); 
            $table->string('payment_password')->nullable(); 
            $table->string('payment_organization', 100)->nullable(); 
            $table->string('bu_code', 50)->nullable(); 

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

        });
    }

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