<?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 Version20221023131643 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 DROP FOREIGN KEY FK_4D3F0D65CCD7E912');
        $this->addSql('DROP INDEX IDX_4D3F0D65CCD7E912 ON extra');
        $this->addSql('ALTER TABLE extra DROP menu_id');
        $this->addSql('ALTER TABLE extra_type ADD menu_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE extra_type ADD CONSTRAINT FK_18A39437CCD7E912 FOREIGN KEY (menu_id) REFERENCES menu (id)');
        $this->addSql('CREATE INDEX IDX_18A39437CCD7E912 ON extra_type (menu_id)');
    }

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