<?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 Version20211217154117 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 org_unit_author (org_unit_id INT NOT NULL, author_id INT NOT NULL, INDEX IDX_B67A69D88BC224C3 (org_unit_id), INDEX IDX_B67A69D8F675F31B (author_id), PRIMARY KEY(org_unit_id, author_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE org_unit_author ADD CONSTRAINT FK_B67A69D88BC224C3 FOREIGN KEY (org_unit_id) REFERENCES org_unit (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE org_unit_author ADD CONSTRAINT FK_B67A69D8F675F31B FOREIGN KEY (author_id) REFERENCES author (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 org_unit_author');
}
}