<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::connection('mai1')->create('mobile_pin_reset_tokens', function (Blueprint $table) {
            $table->id();
            $table->string('nouid')->index();
            $table->string('phone')->index();
            $table->string('token_hash', 64)->unique();
            $table->timestamp('expires_at')->index();
            $table->timestamp('used_at')->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::connection('mai1')->dropIfExists('mobile_pin_reset_tokens');
    }
};
