<?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 Version20200210180335 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('CREATE TABLE infos_event (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) DEFAULT NULL, anchor VARCHAR(255) NOT NULL, link VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE language DROP FOREIGN KEY FK_D4DB71B57E773F7D');
$this->addSql('DROP INDEX UNIQ_D4DB71B57E773F7D ON language');
$this->addSql('ALTER TABLE language DROP infos_residence_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('DROP TABLE infos_event');
$this->addSql('ALTER TABLE language ADD infos_residence_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE language ADD CONSTRAINT FK_D4DB71B57E773F7D FOREIGN KEY (infos_residence_id) REFERENCES infos_residence (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_D4DB71B57E773F7D ON language (infos_residence_id)');
}
}