migrations/Version20220705132300.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 Version20220705132300 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 speaky_part_event DROP FOREIGN KEY FK_B104802CA8B9788D');
  19.         $this->addSql('ALTER TABLE speaky_part_event DROP FOREIGN KEY FK_B104802CFDFF2E92');
  20.         $this->addSql('DROP INDEX UNIQ_B104802CA8B9788D ON speaky_part_event');
  21.         $this->addSql('DROP INDEX UNIQ_B104802CFDFF2E92 ON speaky_part_event');
  22.         $this->addSql('ALTER TABLE speaky_part_event ADD thumbnail VARCHAR(255) DEFAULT NULL, ADD speaky_thumbnail VARCHAR(255) DEFAULT NULL, DROP thumbnail_id, DROP speaky_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 speaky_part_event ADD thumbnail_id INT DEFAULT NULL, ADD speaky_thumbnail_id INT DEFAULT NULL, DROP thumbnail, DROP speaky_thumbnail');
  28.         $this->addSql('ALTER TABLE speaky_part_event ADD CONSTRAINT FK_B104802CA8B9788D FOREIGN KEY (speaky_thumbnail_id) REFERENCES media_file (id)');
  29.         $this->addSql('ALTER TABLE speaky_part_event ADD CONSTRAINT FK_B104802CFDFF2E92 FOREIGN KEY (thumbnail_id) REFERENCES media_file (id)');
  30.         $this->addSql('CREATE UNIQUE INDEX UNIQ_B104802CA8B9788D ON speaky_part_event (speaky_thumbnail_id)');
  31.         $this->addSql('CREATE UNIQUE INDEX UNIQ_B104802CFDFF2E92 ON speaky_part_event (thumbnail_id)');
  32.     }
  33. }