<?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 Version20220211131433 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 domain_product (domain_id INT NOT NULL, product_id INT NOT NULL, INDEX IDX_319D1DB5115F0EE5 (domain_id), INDEX IDX_319D1DB54584665A (product_id), PRIMARY KEY(domain_id, product_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE domain_product ADD CONSTRAINT FK_319D1DB5115F0EE5 FOREIGN KEY (domain_id) REFERENCES domain (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE domain_product ADD CONSTRAINT FK_319D1DB54584665A FOREIGN KEY (product_id) REFERENCES product (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 domain_product');
}
}