<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

final class Version20260224214219 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Ajouter la table saved_column_mappings pour réutiliser les mappings d\'import';
    }

    public function up(Schema $schema): void
    {
        $this->addSql(<<<'SQL'
            CREATE TABLE saved_column_mappings (
                tenant_id UUID NOT NULL,
                format VARCHAR(50) NOT NULL,
                mapping_data JSONB NOT NULL,
                saved_at TIMESTAMPTZ NOT NULL,
                PRIMARY KEY (tenant_id, format)
            )
        SQL);
    }

    public function down(Schema $schema): void
    {
        $this->addSql('DROP TABLE saved_column_mappings');
    }
}
