<?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 Version20220518065235 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('CREATE TABLE production_batch_invoice (production_batch_id INT NOT NULL, invoice_id INT NOT NULL, INDEX IDX_5A4F20FABE9059E (production_batch_id), INDEX IDX_5A4F20FA2989F1FD (invoice_id), PRIMARY KEY(production_batch_id, invoice_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE production_batch_invoice ADD CONSTRAINT FK_5A4F20FABE9059E FOREIGN KEY (production_batch_id) REFERENCES production_batch (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE production_batch_invoice ADD CONSTRAINT FK_5A4F20FA2989F1FD FOREIGN KEY (invoice_id) REFERENCES invoice (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE production_batch_invoice');
}
}