<?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 Version20260731074758 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 appointments ADD course_session_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE appointments ADD CONSTRAINT FK_6A41727ABEDDA25C FOREIGN KEY (course_session_id) REFERENCES course_sessions (id) ON DELETE SET NULL');
        $this->addSql('CREATE INDEX IDX_6A41727ABEDDA25C ON appointments (course_session_id)');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE appointments DROP FOREIGN KEY FK_6A41727ABEDDA25C');
        $this->addSql('DROP INDEX IDX_6A41727ABEDDA25C ON appointments');
        $this->addSql('ALTER TABLE appointments DROP course_session_id');
    }
}
