<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Bridge\Doctrine\Migrations;

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

final class Version20260722170000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Ajoute la classification Commerce, l’activation d’export et l’âge minimum au niveau des catégories produit.';
    }

    public function up(Schema $schema): void
    {
        $this->addSql("ALTER TABLE product_category ADD commerce_export_enabled BOOLEAN DEFAULT FALSE NOT NULL");
        $this->addSql("ALTER TABLE product_category ADD commerce_product_type VARCHAR(32) DEFAULT 'unknown' NOT NULL");
        $this->addSql('ALTER TABLE product_category ADD minimum_purchase_age SMALLINT DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE product_category DROP commerce_export_enabled');
        $this->addSql('ALTER TABLE product_category DROP commerce_product_type');
        $this->addSql('ALTER TABLE product_category DROP minimum_purchase_age');
    }
}
