<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

final class Version20260507230000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add device.current_rendered_at so 304 cache check can detect re-renders';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE device ADD current_rendered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
        $this->addSql("COMMENT ON COLUMN device.current_rendered_at IS '(DC2Type:datetime_immutable)'");
    }

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