<?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 Version20220628171741 extends AbstractMigration
{
public function getDescription(): string
{
return 'Roster: Cascade delete on Leagues';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE roster DROP FOREIGN KEY FK_60B9ADF958AFC4DE');
$this->addSql('ALTER TABLE roster ADD CONSTRAINT FK_60B9ADF958AFC4DE FOREIGN KEY (league_id) REFERENCES ligue (idligue) ON DELETE CASCADE');
$this->addSql('ALTER TABLE `match` DROP FOREIGN KEY FK_7A5BC50558AFC4DE');
$this->addSql('ALTER TABLE `match` ADD CONSTRAINT FK_7A5BC50558AFC4DE FOREIGN KEY (league_id) REFERENCES ligue (idligue) 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 roster DROP FOREIGN KEY FK_60B9ADF958AFC4DE');
$this->addSql('ALTER TABLE roster ADD CONSTRAINT FK_60B9ADF958AFC4DE FOREIGN KEY (league_id) REFERENCES ligue (idligue) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('ALTER TABLE `match` DROP FOREIGN KEY FK_7A5BC50558AFC4DE');
$this->addSql('ALTER TABLE `match` ADD CONSTRAINT FK_7A5BC50558AFC4DE FOREIGN KEY (league_id) REFERENCES ligue (idligue) ON UPDATE NO ACTION ON DELETE NO ACTION');
}
}