<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

final class Version20260515120000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add user.design_version — opt-in flag for the v2 (dusks) redesign; null defaults to v1';
    }

    public function up(Schema $schema): void
    {
        // Nullable on purpose: null means the user has never touched the preference,
        // which the app treats as v1. New explicit values are 'v1' or 'v2'.
        $this->addSql('ALTER TABLE "user" ADD design_version VARCHAR(10) DEFAULT NULL');
    }

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