<?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 Version20220105200819 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 policy_insurer (policy_id INT NOT NULL, insurer_id INT NOT NULL, INDEX IDX_C1F7F92B2D29E3C6 (policy_id), INDEX IDX_C1F7F92B895854C7 (insurer_id), PRIMARY KEY(policy_id, insurer_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE policy_insurer ADD CONSTRAINT FK_C1F7F92B2D29E3C6 FOREIGN KEY (policy_id) REFERENCES policy (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE policy_insurer ADD CONSTRAINT FK_C1F7F92B895854C7 FOREIGN KEY (insurer_id) REFERENCES insurer (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE policy_insurer');
}
}