<?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 Version20231220161353 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 judge_card DROP FOREIGN KEY FK_50E1274393CB796C');
$this->addSql('ALTER TABLE judge_card DROP FOREIGN KEY FK_50E12743BDA4B4CE');
$this->addSql('ALTER TABLE judge_card DROP FOREIGN KEY FK_50E12743139DF194');
$this->addSql('ALTER TABLE judge_card DROP FOREIGN KEY FK_50E12743B7D66194');
$this->addSql('ALTER TABLE judge_card ADD CONSTRAINT FK_50E1274393CB796C FOREIGN KEY (file_id) REFERENCES file (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE judge_card ADD CONSTRAINT FK_50E12743BDA4B4CE FOREIGN KEY (linked_promotion_id) REFERENCES promotion (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE judge_card ADD CONSTRAINT FK_50E12743139DF194 FOREIGN KEY (promotion_id) REFERENCES promotion (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE judge_card ADD CONSTRAINT FK_50E12743B7D66194 FOREIGN KEY (judge_id) REFERENCES judge (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE judge_card DROP FOREIGN KEY FK_50E1274393CB796C');
$this->addSql('ALTER TABLE judge_card DROP FOREIGN KEY FK_50E12743B7D66194');
$this->addSql('ALTER TABLE judge_card DROP FOREIGN KEY FK_50E12743139DF194');
$this->addSql('ALTER TABLE judge_card DROP FOREIGN KEY FK_50E12743BDA4B4CE');
$this->addSql('ALTER TABLE judge_card ADD CONSTRAINT FK_50E1274393CB796C FOREIGN KEY (file_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE judge_card ADD CONSTRAINT FK_50E12743B7D66194 FOREIGN KEY (judge_id) REFERENCES judge (id)');
$this->addSql('ALTER TABLE judge_card ADD CONSTRAINT FK_50E12743139DF194 FOREIGN KEY (promotion_id) REFERENCES promotion (id)');
$this->addSql('ALTER TABLE judge_card ADD CONSTRAINT FK_50E12743BDA4B4CE FOREIGN KEY (linked_promotion_id) REFERENCES promotion (id)');
}
}