<?php

/*
 * This file is part of the VITICORE2 package.
 *
 * (c) CP Creation <web@cpcreation.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CpCreation\VitiCore\Bridge\Doctrine\Migrations;

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

final class Version20260721123000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Ajoute la reception de commande declaree dans une demande de retractation.';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE cart_withdrawal_request ADD order_received BOOLEAN DEFAULT NULL');
        $this->addSql('ALTER TABLE cart_withdrawal_request ADD received_at DATE DEFAULT NULL');
        $this->addSql("COMMENT ON COLUMN cart_withdrawal_request.received_at IS '(DC2Type:date_immutable)'");
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE cart_withdrawal_request DROP order_received');
        $this->addSql('ALTER TABLE cart_withdrawal_request DROP received_at');
    }
}
