<?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('migration_user_plan', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('wp_user_id')->nullable();
            $table->unsignedBigInteger('xf_user_id')->nullable();
            $table->string('match_type');
            $table->string('email')->nullable();
            $table->string('wp_username')->nullable();
            $table->string('xf_username')->nullable();
            $table->text('note')->nullable();
            $table->string('status')->default('pending');
            $table->unsignedBigInteger('user_id')->nullable();
            $table->timestamps();

            $table->index('match_type');
            $table->index('status');
        });
    }

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