<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Ajoute le support des documents de tâche liés au partage SMB :
 * colonne share_path (chemin relatif sur le partage) et file_name rendu nullable
 * (un lien SMB n'a pas de fichier sur disque).
 */
final class Version20260612131431 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'TaskDocument: add share_path column and make file_name nullable (SMB share links)';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE task_document ADD share_path VARCHAR(1024) DEFAULT NULL');
        $this->addSql('ALTER TABLE task_document ALTER file_name DROP NOT NULL');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE task_document ALTER file_name SET NOT NULL');
        $this->addSql('ALTER TABLE task_document DROP share_path');
    }
}
