<?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 Version20221022151753 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 extra ADD extra_type_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE extra ADD CONSTRAINT FK_4D3F0D651D978B71 FOREIGN KEY (extra_type_id) REFERENCES extra (id)');
        $this->addSql('CREATE INDEX IDX_4D3F0D651D978B71 ON extra (extra_type_id)');
        $this->addSql('ALTER TABLE extra_type DROP FOREIGN KEY FK_18A394372B959FC6');
        $this->addSql('DROP INDEX IDX_18A394372B959FC6 ON extra_type');
        $this->addSql('ALTER TABLE extra_type DROP extra_id');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE extra DROP FOREIGN KEY FK_4D3F0D651D978B71');
        $this->addSql('DROP INDEX IDX_4D3F0D651D978B71 ON extra');
        $this->addSql('ALTER TABLE extra DROP extra_type_id');
        $this->addSql('ALTER TABLE extra_type ADD extra_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE extra_type ADD CONSTRAINT FK_18A394372B959FC6 FOREIGN KEY (extra_id) REFERENCES extra (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
        $this->addSql('CREATE INDEX IDX_18A394372B959FC6 ON extra_type (extra_id)');
    }
}
