<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Bridge\Doctrine\Migrations;

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

final class Version20260722100000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Ajoute une période de publication facultative aux collections de produits.';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE product_collection ADD published_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
        $this->addSql('ALTER TABLE product_collection ADD un_published_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE product_collection DROP published_at');
        $this->addSql('ALTER TABLE product_collection DROP un_published_at');
    }
}
