<?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 Version20220703113612 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_lose ADD ingredient_form_id INT NOT NULL, ADD lose_id INT NOT NULL, ADD value NUMERIC(10, 4) NOT NULL');
$this->addSql('ALTER TABLE ingredient_form_lose ADD CONSTRAINT FK_B4A608385EC190BB FOREIGN KEY (ingredient_form_id) REFERENCES ingredient_form (id)');
$this->addSql('ALTER TABLE ingredient_form_lose ADD CONSTRAINT FK_B4A60838352C56C FOREIGN KEY (lose_id) REFERENCES lose (id)');
$this->addSql('CREATE INDEX IDX_B4A608385EC190BB ON ingredient_form_lose (ingredient_form_id)');
$this->addSql('CREATE INDEX IDX_B4A60838352C56C ON ingredient_form_lose (lose_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_lose DROP FOREIGN KEY FK_B4A608385EC190BB');
$this->addSql('ALTER TABLE ingredient_form_lose DROP FOREIGN KEY FK_B4A60838352C56C');
$this->addSql('DROP INDEX IDX_B4A608385EC190BB ON ingredient_form_lose');
$this->addSql('DROP INDEX IDX_B4A60838352C56C ON ingredient_form_lose');
$this->addSql('ALTER TABLE ingredient_form_lose DROP ingredient_form_id, DROP lose_id, DROP value');
}
}