<?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('clientsregs', function (Blueprint $table) {
            $table->id();
            $table->string('firstname',100)->nullable();
            $table->string('lastname',100)->nullable();
            $table->string('phone',15)->unique();
            $table->string('otp',15)->nullable();
            $table->string('email', 150)->unique()->nullable()->comment('Foydalanuvchi email manzili');
            $table->text('fcm_token')->nullable()->comment('Firebase token manzili');
            $table->enum('device_type', ['android', 'ios', 'web'])->nullable()->comment('Qurilma turi');
            $table->boolean('active')->default(false);
            $table->timestamp('code_sent_at')->nullable();
            $table->timestamp('code_expires_at')->nullable();
            $table->string('password',)->nullable()->comment('Parol');
            $table->timestamps();
        });
    }

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