<?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 Version20200205124245 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('DROP INDEX UNIQ_9AF8D882B213FA5 ON infos_residence');
$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)');
}
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('CREATE UNIQUE INDEX UNIQ_9AF8D882B213FA5 ON infos_residence (lang_id)');
$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');
}
}