<?php

declare(strict_types=1);


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::table('users', function (Blueprint $table) {
            $table->string('legacy_md5', 32)->nullable()->index();
            $table->string('url', 255)->nullable();
            $table->unsignedInteger('logincount')->default(0);
            $table->string('loginip', 64)->nullable();
            $table->string('regip', 64)->nullable();
            $table->timestamp('logintime')->nullable();
            $table->timestamp('lastpost_at')->nullable();
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn([
                'legacy_md5', 'url', 'logincount', 'loginip', 'regip', 'logintime', 'lastpost_at',
            ]);
        });
    }
};
