<?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 Version20221104183508 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 artist ADD thumbnail_id INT NOT NULL');
$this->addSql('ALTER TABLE artist ADD CONSTRAINT FK_1599687FDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES image (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1599687FDFF2E92 ON artist (thumbnail_id)');
$this->addSql('ALTER TABLE artwork ADD thumbnail_id INT NOT NULL');
$this->addSql('ALTER TABLE artwork ADD CONSTRAINT FK_881FC576FDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES image (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_881FC576FDFF2E92 ON artwork (thumbnail_id)');
$this->addSql('ALTER TABLE images_exposition ADD thumbnail_id INT NOT NULL');
$this->addSql('ALTER TABLE images_exposition ADD CONSTRAINT FK_D97D09CFDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES image (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_D97D09CFDFF2E92 ON images_exposition (thumbnail_id)');
$this->addSql('ALTER TABLE user ADD thumbnail_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649FDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES image (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649FDFF2E92 ON user (thumbnail_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649FDFF2E92');
$this->addSql('DROP INDEX UNIQ_8D93D649FDFF2E92 ON user');
$this->addSql('ALTER TABLE user DROP thumbnail_id');
$this->addSql('ALTER TABLE images_exposition DROP FOREIGN KEY FK_D97D09CFDFF2E92');
$this->addSql('DROP INDEX UNIQ_D97D09CFDFF2E92 ON images_exposition');
$this->addSql('ALTER TABLE images_exposition DROP thumbnail_id');
$this->addSql('ALTER TABLE artwork DROP FOREIGN KEY FK_881FC576FDFF2E92');
$this->addSql('DROP INDEX UNIQ_881FC576FDFF2E92 ON artwork');
$this->addSql('ALTER TABLE artwork DROP thumbnail_id');
$this->addSql('ALTER TABLE artist DROP FOREIGN KEY FK_1599687FDFF2E92');
$this->addSql('DROP INDEX UNIQ_1599687FDFF2E92 ON artist');
$this->addSql('ALTER TABLE artist DROP thumbnail_id');
}
}