migrations/Version20220601121725.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 Version20220601121725 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 page DROP FOREIGN KEY FK_140AB620739DEC3E');
  19.         $this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620FDFF2E92');
  20.         $this->addSql('DROP INDEX UNIQ_140AB620739DEC3E ON page');
  21.         $this->addSql('DROP INDEX UNIQ_140AB620FDFF2E92 ON page');
  22.         $this->addSql('ALTER TABLE page ADD thumbnail VARCHAR(255) DEFAULT NULL, ADD mobile_thumbnail VARCHAR(255) DEFAULT NULL, DROP thumbnail_id, DROP mobile_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 page ADD thumbnail_id INT DEFAULT NULL, ADD mobile_thumbnail_id INT DEFAULT NULL, DROP thumbnail, DROP mobile_thumbnail');
  28.         $this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620739DEC3E FOREIGN KEY (mobile_thumbnail_id) REFERENCES media_file (id)');
  29.         $this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620FDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES media_file (id)');
  30.         $this->addSql('CREATE UNIQUE INDEX UNIQ_140AB620739DEC3E ON page (mobile_thumbnail_id)');
  31.         $this->addSql('CREATE UNIQUE INDEX UNIQ_140AB620FDFF2E92 ON page (thumbnail_id)');
  32.     }
  33. }