<?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 Version20260609133334 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('CREATE TABLE doctor_insurances (id INT AUTO_INCREMENT NOT NULL, price INT DEFAULT NULL, doctor_id INT NOT NULL, category_id INT NOT NULL, INDEX IDX_5317E58E87F4FB17 (doctor_id), INDEX idx_doctor_insurance_cat (category_id), UNIQUE INDEX idx_doctor_insurance (doctor_id, category_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
        $this->addSql('ALTER TABLE doctor_insurances ADD CONSTRAINT FK_5317E58E87F4FB17 FOREIGN KEY (doctor_id) REFERENCES doctors (id) ON DELETE CASCADE');
        $this->addSql('ALTER TABLE doctor_insurances ADD CONSTRAINT FK_5317E58E12469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE doctor_insurances DROP FOREIGN KEY FK_5317E58E87F4FB17');
        $this->addSql('ALTER TABLE doctor_insurances DROP FOREIGN KEY FK_5317E58E12469DE2');
        $this->addSql('DROP TABLE doctor_insurances');
    }
}
