<?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 Version20221201091608 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 advertisement ADD logo_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE advertisement ADD CONSTRAINT FK_C95F6AEEF98F144A FOREIGN KEY (logo_id) REFERENCES picture (id)');
$this->addSql('CREATE INDEX IDX_C95F6AEEF98F144A ON advertisement (logo_id)');
$this->addSql('ALTER TABLE picture ADD advertisement_dpe_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE picture ADD CONSTRAINT FK_16DB4F89FC48F850 FOREIGN KEY (advertisement_dpe_id) REFERENCES advertisement (id)');
$this->addSql('CREATE INDEX IDX_16DB4F89FC48F850 ON picture (advertisement_dpe_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE advertisement DROP FOREIGN KEY FK_C95F6AEEF98F144A');
$this->addSql('DROP INDEX IDX_C95F6AEEF98F144A ON advertisement');
$this->addSql('ALTER TABLE advertisement DROP logo_id');
$this->addSql('ALTER TABLE picture DROP FOREIGN KEY FK_16DB4F89FC48F850');
$this->addSql('DROP INDEX IDX_16DB4F89FC48F850 ON picture');
$this->addSql('ALTER TABLE picture DROP advertisement_dpe_id');
}
}