<?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 Version20260713195434 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 deposit_required TINYINT DEFAULT 0 NOT NULL, ADD deposit_amount_rials INT DEFAULT NULL, ADD is_reserve TINYINT DEFAULT 0 NOT NULL, ADD service_section_id INT DEFAULT NULL, ADD service_item_id INT DEFAULT NULL, ADD staff_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE appointments ADD CONSTRAINT FK_6A41727A4E72DACE FOREIGN KEY (service_section_id) REFERENCES service_sections (id) ON DELETE SET NULL');
        $this->addSql('ALTER TABLE appointments ADD CONSTRAINT FK_6A41727ADDEB00C2 FOREIGN KEY (service_item_id) REFERENCES service_items (id) ON DELETE SET NULL');
        $this->addSql('ALTER TABLE appointments ADD CONSTRAINT FK_6A41727AD4D57CD FOREIGN KEY (staff_id) REFERENCES clinic_staff (id) ON DELETE SET NULL');
        $this->addSql('CREATE INDEX IDX_6A41727A4E72DACE ON appointments (service_section_id)');
        $this->addSql('CREATE INDEX IDX_6A41727ADDEB00C2 ON appointments (service_item_id)');
        $this->addSql('CREATE INDEX IDX_6A41727AD4D57CD ON appointments (staff_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_6A41727A4E72DACE');
        $this->addSql('ALTER TABLE appointments DROP FOREIGN KEY FK_6A41727ADDEB00C2');
        $this->addSql('ALTER TABLE appointments DROP FOREIGN KEY FK_6A41727AD4D57CD');
        $this->addSql('DROP INDEX IDX_6A41727A4E72DACE ON appointments');
        $this->addSql('DROP INDEX IDX_6A41727ADDEB00C2 ON appointments');
        $this->addSql('DROP INDEX IDX_6A41727AD4D57CD ON appointments');
        $this->addSql('ALTER TABLE appointments DROP deposit_required, DROP deposit_amount_rials, DROP is_reserve, DROP service_section_id, DROP service_item_id, DROP staff_id');
    }
}
