<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20200211103850 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 infos_discover_link ADD lang_id INT NOT NULL');
$this->addSql('ALTER TABLE infos_discover_link ADD CONSTRAINT FK_696EBB9FB213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
$this->addSql('CREATE INDEX IDX_696EBB9FB213FA4 ON infos_discover_link (lang_id)');
$this->addSql('ALTER TABLE infos_event ADD lang_id INT NOT NULL');
$this->addSql('ALTER TABLE infos_event ADD CONSTRAINT FK_7456EA85B213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
$this->addSql('CREATE INDEX IDX_7456EA85B213FA4 ON infos_event (lang_id)');
$this->addSql('ALTER TABLE infos_discover ADD lang_id INT NOT NULL');
$this->addSql('ALTER TABLE infos_discover ADD CONSTRAINT FK_3FE06DAAB213FA4 FOREIGN KEY (lang_id) REFERENCES language (id)');
$this->addSql('CREATE INDEX IDX_3FE06DAAB213FA4 ON infos_discover (lang_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 infos_discover DROP FOREIGN KEY FK_3FE06DAAB213FA4');
$this->addSql('DROP INDEX IDX_3FE06DAAB213FA4 ON infos_discover');
$this->addSql('ALTER TABLE infos_discover DROP lang_id');
$this->addSql('ALTER TABLE infos_discover_link DROP FOREIGN KEY FK_696EBB9FB213FA4');
$this->addSql('DROP INDEX IDX_696EBB9FB213FA4 ON infos_discover_link');
$this->addSql('ALTER TABLE infos_discover_link DROP lang_id');
$this->addSql('ALTER TABLE infos_event DROP FOREIGN KEY FK_7456EA85B213FA4');
$this->addSql('DROP INDEX IDX_7456EA85B213FA4 ON infos_event');
$this->addSql('ALTER TABLE infos_event DROP lang_id');
}
}