<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20260408174704 extends AbstractMigration
{
    public function getDescription(): string
    {
        return '';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE advert_payment ADD echeancier_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE advert_payment ADD CONSTRAINT FK_C766C45B8C858AF2 FOREIGN KEY (echeancier_id) REFERENCES echeancier (id) ON DELETE SET NULL NOT DEFERRABLE');
        $this->addSql('CREATE INDEX IDX_C766C45B8C858AF2 ON advert_payment (echeancier_id)');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE advert_payment DROP CONSTRAINT FK_C766C45B8C858AF2');
        $this->addSql('DROP INDEX IDX_C766C45B8C858AF2');
        $this->addSql('ALTER TABLE advert_payment DROP echeancier_id');
    }
}
