<?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 Version20220512105332 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 citizen_nationality (citizen_id INT NOT NULL, nationality_id INT NOT NULL, INDEX IDX_CC090053A63C3C2E (citizen_id), INDEX IDX_CC0900531C9DA55 (nationality_id), PRIMARY KEY(citizen_id, nationality_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE citizen_nationality ADD CONSTRAINT FK_CC090053A63C3C2E FOREIGN KEY (citizen_id) REFERENCES citizen (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE citizen_nationality ADD CONSTRAINT FK_CC0900531C9DA55 FOREIGN KEY (nationality_id) REFERENCES nationality (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 citizen_nationality');
}
}