<?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 Version20251015155540 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add CASCADE delete constraint to privatisation_history.privatisation_id foreign key';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE privatisation_history DROP FOREIGN KEY FK_1E65406ECE4BE7FC');
$this->addSql('ALTER TABLE privatisation_history ADD CONSTRAINT FK_1E65406ECE4BE7FC FOREIGN KEY (privatisation_id) REFERENCES privatisation (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 privatisation_history DROP FOREIGN KEY FK_1E65406ECE4BE7FC');
$this->addSql('ALTER TABLE privatisation_history ADD CONSTRAINT FK_1E65406ECE4BE7FC FOREIGN KEY (privatisation_id) REFERENCES privatisation (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
}
}