<?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 Version20240103133228 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_generic_recommendation (domain_id INT NOT NULL, generic_recommendation_id INT NOT NULL, INDEX IDX_B71D0B2E115F0EE5 (domain_id), INDEX IDX_B71D0B2E56172DE7 (generic_recommendation_id), PRIMARY KEY(domain_id, generic_recommendation_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE domain_generic_recommendation ADD CONSTRAINT FK_B71D0B2E115F0EE5 FOREIGN KEY (domain_id) REFERENCES domain (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE domain_generic_recommendation ADD CONSTRAINT FK_B71D0B2E56172DE7 FOREIGN KEY (generic_recommendation_id) REFERENCES recommendation (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE domain_generic_recommendation DROP FOREIGN KEY FK_B71D0B2E115F0EE5');
$this->addSql('ALTER TABLE domain_generic_recommendation DROP FOREIGN KEY FK_B71D0B2E56172DE7');
$this->addSql('DROP TABLE domain_generic_recommendation');
}
}