<?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 Version20250310140210 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 user_trip ADD signature_id INT DEFAULT NULL, ADD completed_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', DROP start_date, DROP end_date');
        $this->addSql('ALTER TABLE user_trip ADD CONSTRAINT FK_CD7B9F2ED61183A FOREIGN KEY (signature_id) REFERENCES media_object (id) ON DELETE SET NULL');
        $this->addSql('CREATE INDEX IDX_CD7B9F2ED61183A ON user_trip (signature_id)');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE user_trip DROP FOREIGN KEY FK_CD7B9F2ED61183A');
        $this->addSql('DROP INDEX IDX_CD7B9F2ED61183A ON user_trip');
        $this->addSql('ALTER TABLE user_trip ADD end_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', DROP signature_id, CHANGE completed_date start_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
    }
}
