<?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 Version20200205110401 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_residence ADD CONSTRAINT FK_9AF8D882B213FA5 FOREIGN KEY (lang_id) REFERENCES language (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_9AF8D882B213FA5 ON infos_residence (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_residence DROP FOREIGN KEY FK_9AF8D882B213FA5');
$this->addSql('DROP INDEX UNIQ_9AF8D882B213FA5 ON infos_residence');
}
}