<?php declare (strict_types = 1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20180409131841 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE membership_document (`membership_id` INT NOT NULL, `document_id` INT NOT NULL, INDEX IDX_C48C46823E2CBC4F (`membership_id`), INDEX IDX_C48C46825D9C4E11 (`document_id`), PRIMARY KEY(`membership_id`, `document_id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE membership_document ADD CONSTRAINT FK_C48C46823E2CBC4F FOREIGN KEY (`membership_id`) REFERENCES membership (`id`) ON DELETE CASCADE');
$this->addSql('ALTER TABLE membership_document ADD CONSTRAINT FK_C48C46825D9C4E11 FOREIGN KEY (`document_id`) REFERENCES document (`id`) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE membership_document');
}
}