<?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 Version20260205084002 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 devis ADD distance DOUBLE PRECISION DEFAULT NULL');
        $this->addSql('ALTER TABLE devis ADD price_ship DOUBLE PRECISION DEFAULT NULL');
        $this->addSql('ALTER TABLE devis ADD payment_method VARCHAR(255) DEFAULT NULL');
        $this->addSql('ALTER TABLE devis ADD order_session_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE devis ADD CONSTRAINT FK_8B27C52BD2E5118A FOREIGN KEY (order_session_id) REFERENCES order_session (id)');
        $this->addSql('CREATE UNIQUE INDEX UNIQ_8B27C52BD2E5118A ON devis (order_session_id)');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE devis DROP CONSTRAINT FK_8B27C52BD2E5118A');
        $this->addSql('DROP INDEX UNIQ_8B27C52BD2E5118A');
        $this->addSql('ALTER TABLE devis DROP distance');
        $this->addSql('ALTER TABLE devis DROP price_ship');
        $this->addSql('ALTER TABLE devis DROP payment_method');
        $this->addSql('ALTER TABLE devis DROP order_session_id');
    }
}
