migrations/Version20220427103944.php line 1

  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 Version20220427103944 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 category DROP FOREIGN KEY FK_64C19C1482F1214');
  19.         $this->addSql('ALTER TABLE category DROP FOREIGN KEY FK_64C19C1739DEC3E');
  20.         $this->addSql('DROP INDEX UNIQ_64C19C1482F1214 ON category');
  21.         $this->addSql('DROP INDEX UNIQ_64C19C1739DEC3E ON category');
  22.         $this->addSql('ALTER TABLE category ADD mobile_thumbnail VARCHAR(255) DEFAULT NULL, ADD weekly_trophy_thumbnail VARCHAR(255) DEFAULT NULL, DROP mobile_thumbnail_id, DROP weekly_trophy_thumbnail_id');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('ALTER TABLE category ADD mobile_thumbnail_id INT DEFAULT NULL, ADD weekly_trophy_thumbnail_id INT DEFAULT NULL, DROP mobile_thumbnail, DROP weekly_trophy_thumbnail');
  28.         $this->addSql('ALTER TABLE category ADD CONSTRAINT FK_64C19C1482F1214 FOREIGN KEY (weekly_trophy_thumbnail_id) REFERENCES media_file (id)');
  29.         $this->addSql('ALTER TABLE category ADD CONSTRAINT FK_64C19C1739DEC3E FOREIGN KEY (mobile_thumbnail_id) REFERENCES media_file (id)');
  30.         $this->addSql('CREATE UNIQUE INDEX UNIQ_64C19C1482F1214 ON category (weekly_trophy_thumbnail_id)');
  31.         $this->addSql('CREATE UNIQUE INDEX UNIQ_64C19C1739DEC3E ON category (mobile_thumbnail_id)');
  32.     }
  33. }