<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Bridge\Doctrine\Migrations;

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

final class Version20260603143000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Remplace le token de reference produit par un SKU.';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE product_product DROP COLUMN IF EXISTS reference_token');
        $this->addSql('ALTER TABLE product_product ADD COLUMN IF NOT EXISTS sku VARCHAR(255) DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE product_product DROP COLUMN IF EXISTS sku');
        $this->addSql('ALTER TABLE product_product ADD COLUMN IF NOT EXISTS reference_token TEXT DEFAULT NULL');
    }
}
