<?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 Version20210219083337 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 CHANGE residence_id residence_id INT DEFAULT NULL, CHANGE lang_id lang_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE infos_event CHANGE residence_id residence_id INT DEFAULT NULL, CHANGE lang_id lang_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823370A28BD');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_32758236A65BA4A');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823AE1C7F48');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823BC567DD5');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823E139EF22');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823F373EDBF');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823370A28BD FOREIGN KEY (hiveren_id) REFERENCES fiche (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_32758236A65BA4A FOREIGN KEY (hiverfr_id) REFERENCES fiche (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823AE1C7F48 FOREIGN KEY (eteen_id) REFERENCES fiche (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823BC567DD5 FOREIGN KEY (saisonen_id) REFERENCES fiche (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823E139EF22 FOREIGN KEY (saisonfr_id) REFERENCES fiche (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823F373EDBF FOREIGN KEY (etefr_id) REFERENCES fiche (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE fiche ADD CONSTRAINT FK_4C13CC78EA9FDD75 FOREIGN KEY (media_id) REFERENCES media (id)');
$this->addSql('ALTER TABLE offre DROP FOREIGN KEY FK_AF86866F4B6B3CFA');
$this->addSql('ALTER TABLE offre DROP FOREIGN KEY FK_AF86866FEA9FDD75');
$this->addSql('ALTER TABLE offre CHANGE residence_id residence_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE offre ADD CONSTRAINT FK_AF86866F4B6B3CFA FOREIGN KEY (mediaen_id) REFERENCES media (id)');
$this->addSql('ALTER TABLE offre ADD CONSTRAINT FK_AF86866FEA9FDD75 FOREIGN KEY (media_id) REFERENCES media (id)');
$this->addSql('ALTER TABLE infos_residence CHANGE residence_id residence_id INT DEFAULT NULL, CHANGE lang_id lang_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE typologie CHANGE residence_id residence_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE infos_discover CHANGE residence_id residence_id INT DEFAULT NULL, CHANGE lang_id lang_id INT DEFAULT 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 fiche DROP FOREIGN KEY FK_4C13CC78EA9FDD75');
$this->addSql('ALTER TABLE infos_discover CHANGE residence_id residence_id INT NOT NULL, CHANGE lang_id lang_id INT NOT NULL');
$this->addSql('ALTER TABLE infos_discover_link CHANGE residence_id residence_id INT NOT NULL, CHANGE lang_id lang_id INT NOT NULL');
$this->addSql('ALTER TABLE infos_event CHANGE residence_id residence_id INT NOT NULL, CHANGE lang_id lang_id INT NOT NULL');
$this->addSql('ALTER TABLE infos_residence CHANGE residence_id residence_id INT NOT NULL, CHANGE lang_id lang_id INT NOT NULL');
$this->addSql('ALTER TABLE offre DROP FOREIGN KEY FK_AF86866FEA9FDD75');
$this->addSql('ALTER TABLE offre DROP FOREIGN KEY FK_AF86866F4B6B3CFA');
$this->addSql('ALTER TABLE offre CHANGE residence_id residence_id INT NOT NULL');
$this->addSql('ALTER TABLE offre ADD CONSTRAINT FK_AF86866FEA9FDD75 FOREIGN KEY (media_id) REFERENCES media (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE offre ADD CONSTRAINT FK_AF86866F4B6B3CFA FOREIGN KEY (mediaen_id) REFERENCES media (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823F373EDBF');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823AE1C7F48');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_32758236A65BA4A');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823370A28BD');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823E139EF22');
$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_3275823BC567DD5');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823F373EDBF FOREIGN KEY (etefr_id) REFERENCES fiche (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823AE1C7F48 FOREIGN KEY (eteen_id) REFERENCES fiche (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_32758236A65BA4A FOREIGN KEY (hiverfr_id) REFERENCES fiche (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823370A28BD FOREIGN KEY (hiveren_id) REFERENCES fiche (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823E139EF22 FOREIGN KEY (saisonfr_id) REFERENCES fiche (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_3275823BC567DD5 FOREIGN KEY (saisonen_id) REFERENCES fiche (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE typologie CHANGE residence_id residence_id INT NOT NULL');
}
}