<?php
declare(strict_types=1);
namespace PPSDKDoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220606164535_GeneralContestArticle extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE articles ADD general_contest_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE articles ADD CONSTRAINT FK_BFDD31686FEFD24F FOREIGN KEY (general_contest_id) REFERENCES general_contests (id)');
$this->addSql('CREATE INDEX IDX_BFDD31686FEFD24F ON articles (general_contest_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE articles DROP FOREIGN KEY FK_BFDD31686FEFD24F');
$this->addSql('DROP INDEX IDX_BFDD31686FEFD24F ON articles');
$this->addSql('ALTER TABLE articles DROP general_contest_id');
}
}