<?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 Version20260615203529 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 comments ADD parent_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE comments ADD CONSTRAINT FK_5F9E962A727ACA70 FOREIGN KEY (parent_id) REFERENCES comments (id) ON DELETE CASCADE');
        $this->addSql('CREATE INDEX IDX_5F9E962A727ACA70 ON comments (parent_id)');
        $this->addSql('ALTER TABLE likes ADD value SMALLINT NOT NULL');
        $this->addSql('ALTER TABLE rates ADD accuracy_of_diagnosis SMALLINT NOT NULL, ADD doctor_behavior SMALLINT NOT NULL, ADD clinic_cleanliness SMALLINT NOT NULL, ADD doctor_expertise SMALLINT NOT NULL, CHANGE score waiting_time_at_clinic SMALLINT NOT NULL');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE comments DROP FOREIGN KEY FK_5F9E962A727ACA70');
        $this->addSql('DROP INDEX IDX_5F9E962A727ACA70 ON comments');
        $this->addSql('ALTER TABLE comments DROP parent_id');
        $this->addSql('ALTER TABLE likes DROP value');
        $this->addSql('ALTER TABLE rates ADD score SMALLINT NOT NULL, DROP waiting_time_at_clinic, DROP accuracy_of_diagnosis, DROP doctor_behavior, DROP clinic_cleanliness, DROP doctor_expertise');
    }
}
