<?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 Version20200205090715 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 residence DROP FOREIGN KEY FK_32758237E773F7D');
$this->addSql('DROP INDEX UNIQ_32758237E773F7D ON residence');
$this->addSql('ALTER TABLE residence DROP infos_residence_id');
$this->addSql('ALTER TABLE language ADD `default` TINYINT(1) DEFAULT \'0\' NOT NULL');
}
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 language DROP `default`');
$this->addSql('ALTER TABLE residence ADD infos_residence_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_32758237E773F7D FOREIGN KEY (infos_residence_id) REFERENCES infos_residence (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_32758237E773F7D ON residence (infos_residence_id)');
}
}