<?php
namespace FleekDash\Database\Migrations;

use FleekDash\Database\Core\BaseMigration;
use FleekDash\Database\Core\TableBuilder;

/**
 * Create Accounts Table
 *
 * Converted from Eloquent Schema to WordPress dbDelta
 */
return new class extends BaseMigration {

    public function up(): void
    {
        $this->createTable('accounts', function (TableBuilder $table) {
            $table->id();
            $table->string('user_id', 255);
            $table->string('host', 255);
            $table->integer('port');
            $table->string('first_name', 255);
            $table->string('last_name', 255);
            $table->string('email', 255);
            $table->string('name', 255);
            $table->string('password', 255);
            $table->timestamps();

            $table->unique('email');
        });
    }

    public function down(): void
    {
        $this->dropTable('accounts');
    }
};

