<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Bridge\Doctrine\Migrations;

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

final class Version20260603144500 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Supprime les anciens champs favoris produits.';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE product_product DROP COLUMN IF EXISTS favorite');
        $this->addSql('ALTER TABLE product_product DROP COLUMN IF EXISTS order_in_favorites');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE product_product ADD COLUMN IF NOT EXISTS favorite BOOLEAN DEFAULT false NOT NULL');
        $this->addSql('ALTER TABLE product_product ADD COLUMN IF NOT EXISTS order_in_favorites INT DEFAULT NULL');
    }
}
