migrations/Version20221104183508.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20221104183508 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE artist ADD thumbnail_id INT NOT NULL');
  19.         $this->addSql('ALTER TABLE artist ADD CONSTRAINT FK_1599687FDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES image (id)');
  20.         $this->addSql('CREATE UNIQUE INDEX UNIQ_1599687FDFF2E92 ON artist (thumbnail_id)');
  21.         $this->addSql('ALTER TABLE artwork ADD thumbnail_id INT NOT NULL');
  22.         $this->addSql('ALTER TABLE artwork ADD CONSTRAINT FK_881FC576FDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES image (id)');
  23.         $this->addSql('CREATE UNIQUE INDEX UNIQ_881FC576FDFF2E92 ON artwork (thumbnail_id)');
  24.         $this->addSql('ALTER TABLE images_exposition ADD thumbnail_id INT NOT NULL');
  25.         $this->addSql('ALTER TABLE images_exposition ADD CONSTRAINT FK_D97D09CFDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES image (id)');
  26.         $this->addSql('CREATE UNIQUE INDEX UNIQ_D97D09CFDFF2E92 ON images_exposition (thumbnail_id)');
  27.         $this->addSql('ALTER TABLE user ADD thumbnail_id INT DEFAULT NULL');
  28.         $this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649FDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES image (id)');
  29.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649FDFF2E92 ON user (thumbnail_id)');
  30.     }
  31.     public function down(Schema $schema): void
  32.     {
  33.         // this down() migration is auto-generated, please modify it to your needs
  34.         $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649FDFF2E92');
  35.         $this->addSql('DROP INDEX UNIQ_8D93D649FDFF2E92 ON user');
  36.         $this->addSql('ALTER TABLE user DROP thumbnail_id');
  37.         $this->addSql('ALTER TABLE images_exposition DROP FOREIGN KEY FK_D97D09CFDFF2E92');
  38.         $this->addSql('DROP INDEX UNIQ_D97D09CFDFF2E92 ON images_exposition');
  39.         $this->addSql('ALTER TABLE images_exposition DROP thumbnail_id');
  40.         $this->addSql('ALTER TABLE artwork DROP FOREIGN KEY FK_881FC576FDFF2E92');
  41.         $this->addSql('DROP INDEX UNIQ_881FC576FDFF2E92 ON artwork');
  42.         $this->addSql('ALTER TABLE artwork DROP thumbnail_id');
  43.         $this->addSql('ALTER TABLE artist DROP FOREIGN KEY FK_1599687FDFF2E92');
  44.         $this->addSql('DROP INDEX UNIQ_1599687FDFF2E92 ON artist');
  45.         $this->addSql('ALTER TABLE artist DROP thumbnail_id');
  46.     }
  47. }