<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Add optional first name / last name to users.
 */
final class Version20260526120000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add user.first_name and user.last_name (nullable)';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE "user" ADD first_name VARCHAR(100) DEFAULT NULL');
        $this->addSql('ALTER TABLE "user" ADD last_name VARCHAR(100) DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE "user" DROP COLUMN IF EXISTS first_name');
        $this->addSql('ALTER TABLE "user" DROP COLUMN IF EXISTS last_name');
    }
}
