<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Drop the legacy productIds JSON column from pieces table.
 * Data has been migrated to the piece_products join table.
 */
final class Version20260312200000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Drop legacy productIds JSON column from pieces table';
    }

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

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