<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Drop the legacy structure JSON column from composants table.
 * Data has been migrated to composant_piece_slots, composant_subcomponent_slots, composant_product_slots tables.
 */
final class Version20260312210000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Drop legacy structure JSON column from composants table';
    }

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

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE composants ADD COLUMN structure JSON DEFAULT NULL');
    }
}
