<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Adds a soft-delete flag on user. Deleting a user now archives it instead of
 * removing the row, preserving referential integrity (tasks, time entries,
 * notifications…). Existing users are kept active (archived = false).
 */
final class Version20260626153721 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add archived flag on user (soft delete)';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE "user" ADD archived BOOLEAN DEFAULT false NOT NULL');
    }

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