<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220921102134 extends AbstractMigration
{
public function getDescription(): string
{
return 'Fix relation';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE referent DROP FOREIGN KEY FK_FE9AAC6C6995AC4C');
$this->addSql('ALTER TABLE referent ADD CONSTRAINT FK_FE9AAC6C6995AC4C FOREIGN KEY (editor_id) REFERENCES editor (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE referent DROP FOREIGN KEY FK_FE9AAC6C6995AC4C');
$this->addSql('ALTER TABLE referent ADD CONSTRAINT FK_FE9AAC6C6995AC4C FOREIGN KEY (editor_id) REFERENCES editor (id)');
}
}