<?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 Version20220411115622 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('DROP TABLE product_out_request_product_out');
$this->addSql('ALTER TABLE product_out ADD product_out_request_id INT NOT NULL');
$this->addSql('ALTER TABLE product_out ADD CONSTRAINT FK_59C5398692BEB019 FOREIGN KEY (product_out_request_id) REFERENCES product_out_request (id)');
$this->addSql('CREATE INDEX IDX_59C5398692BEB019 ON product_out (product_out_request_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE product_out_request_product_out (product_out_request_id INT NOT NULL, product_out_id INT NOT NULL, INDEX IDX_D1AF314B667319DE (product_out_id), INDEX IDX_D1AF314B92BEB019 (product_out_request_id), PRIMARY KEY(product_out_request_id, product_out_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE product_out_request_product_out ADD CONSTRAINT FK_D1AF314B92BEB019 FOREIGN KEY (product_out_request_id) REFERENCES product_out_request (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE product_out_request_product_out ADD CONSTRAINT FK_D1AF314B667319DE FOREIGN KEY (product_out_id) REFERENCES product_out (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE product_out DROP FOREIGN KEY FK_59C5398692BEB019');
$this->addSql('DROP INDEX IDX_59C5398692BEB019 ON product_out');
$this->addSql('ALTER TABLE product_out DROP product_out_request_id');
}
}