<?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 Version20220709230443 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 ingredient_form_recipe ADD action_id INT DEFAULT NULL, ADD workstation_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE ingredient_form_recipe ADD CONSTRAINT FK_6015AB009D32F035 FOREIGN KEY (action_id) REFERENCES action (id)');
$this->addSql('ALTER TABLE ingredient_form_recipe ADD CONSTRAINT FK_6015AB00E29BB7D FOREIGN KEY (workstation_id) REFERENCES workstation (id)');
$this->addSql('CREATE INDEX IDX_6015AB009D32F035 ON ingredient_form_recipe (action_id)');
$this->addSql('CREATE INDEX IDX_6015AB00E29BB7D ON ingredient_form_recipe (workstation_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE ingredient_form_recipe DROP FOREIGN KEY FK_6015AB009D32F035');
$this->addSql('ALTER TABLE ingredient_form_recipe DROP FOREIGN KEY FK_6015AB00E29BB7D');
$this->addSql('DROP INDEX IDX_6015AB009D32F035 ON ingredient_form_recipe');
$this->addSql('DROP INDEX IDX_6015AB00E29BB7D ON ingredient_form_recipe');
$this->addSql('ALTER TABLE ingredient_form_recipe DROP action_id, DROP workstation_id');
}
}