<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220106205509 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->addSql('ALTER TABLE insured DROP FOREIGN KEY FK_560FF44EE2F8B262');
$this->addSql('DROP INDEX IDX_560FF44EE2F8B262 ON insured');
$this->addSql('ALTER TABLE insured DROP insurers_id');
$this->addSql('ALTER TABLE insured_insurer ADD insured_id INT DEFAULT NULL, ADD insurer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE insured_insurer ADD CONSTRAINT FK_3CB0E6C9FC2A5C84 FOREIGN KEY (insured_id) REFERENCES insured (id)');
$this->addSql('ALTER TABLE insured_insurer ADD CONSTRAINT FK_3CB0E6C9895854C7 FOREIGN KEY (insurer_id) REFERENCES insurer (id)');
$this->addSql('CREATE INDEX IDX_3CB0E6C9FC2A5C84 ON insured_insurer (insured_id)');
$this->addSql('CREATE INDEX IDX_3CB0E6C9895854C7 ON insured_insurer (insurer_id)');
$this->addSql('ALTER TABLE insurer DROP FOREIGN KEY FK_A2DB411FD58D040');
$this->addSql('DROP INDEX IDX_A2DB411FD58D040 ON insurer');
$this->addSql('ALTER TABLE insurer DROP insureds_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE insured ADD insurers_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE insured ADD CONSTRAINT FK_560FF44EE2F8B262 FOREIGN KEY (insurers_id) REFERENCES insured_insurer (id)');
$this->addSql('CREATE INDEX IDX_560FF44EE2F8B262 ON insured (insurers_id)');
$this->addSql('ALTER TABLE insured_insurer DROP FOREIGN KEY FK_3CB0E6C9FC2A5C84');
$this->addSql('ALTER TABLE insured_insurer DROP FOREIGN KEY FK_3CB0E6C9895854C7');
$this->addSql('DROP INDEX IDX_3CB0E6C9FC2A5C84 ON insured_insurer');
$this->addSql('DROP INDEX IDX_3CB0E6C9895854C7 ON insured_insurer');
$this->addSql('ALTER TABLE insured_insurer DROP insured_id, DROP insurer_id');
$this->addSql('ALTER TABLE insurer ADD insureds_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE insurer ADD CONSTRAINT FK_A2DB411FD58D040 FOREIGN KEY (insureds_id) REFERENCES insured_insurer (id)');
$this->addSql('CREATE INDEX IDX_A2DB411FD58D040 ON insurer (insureds_id)');
}
}