<?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 Version20221016163718 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 commande ADD menu_id INT NOT NULL');
$this->addSql('ALTER TABLE commande ADD CONSTRAINT FK_6EEAA67DCCD7E912 FOREIGN KEY (menu_id) REFERENCES menu (id)');
$this->addSql('CREATE INDEX IDX_6EEAA67DCCD7E912 ON commande (menu_id)');
// $this->addSql('ALTER TABLE menu RENAME INDEX fk_7d053a93c4598a51 TO IDX_7D053A93C4598A51');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
// $this->addSql('ALTER TABLE menu RENAME INDEX idx_7d053a93c4598a51 TO FK_7D053A93C4598A51');
$this->addSql('ALTER TABLE commande DROP FOREIGN KEY FK_6EEAA67DCCD7E912');
$this->addSql('DROP INDEX IDX_6EEAA67DCCD7E912 ON commande');
$this->addSql('ALTER TABLE commande DROP menu_id');
}
}