<?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 Version20190715132523 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE event_type ADD organization_unit_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE event_type ADD CONSTRAINT FK_93151B82356FF84E FOREIGN KEY (organization_unit_id) REFERENCES organization_unit (id)');
$this->addSql('CREATE INDEX IDX_93151B82356FF84E ON event_type (organization_unit_id)');
}
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('ALTER TABLE event_type DROP FOREIGN KEY FK_93151B82356FF84E');
$this->addSql('DROP INDEX IDX_93151B82356FF84E ON event_type');
$this->addSql('ALTER TABLE event_type DROP organization_unit_id');
}
}