<?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 Version20220106204613 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('CREATE TABLE insured_insurer (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$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 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)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE insured DROP FOREIGN KEY FK_560FF44EE2F8B262');
$this->addSql('ALTER TABLE insurer DROP FOREIGN KEY FK_A2DB411FD58D040');
$this->addSql('DROP TABLE insured_insurer');
$this->addSql('DROP INDEX IDX_560FF44EE2F8B262 ON insured');
$this->addSql('ALTER TABLE insured DROP insurers_id');
$this->addSql('DROP INDEX IDX_A2DB411FD58D040 ON insurer');
$this->addSql('ALTER TABLE insurer DROP insureds_id');
}
}