migrations/Version20241112083010.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 Version20241112083010 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 t_step DROP FOREIGN KEY FK_F9CF974E2C2AC5D3');
  19. //        $this->addSql('DROP TABLE t_step');
  20. //        $this->addSql('ALTER TABLE step DROP FOREIGN KEY FK_43B9FE3C7E9E4C8C');
  21. //        $this->addSql('DROP INDEX IDX_43B9FE3C7E9E4C8C ON step');
  22. //        $this->addSql('ALTER TABLE step DROP url, DROP notation, CHANGE photo_id revision_id INT DEFAULT NULL');
  23. //        $this->addSql('ALTER TABLE step ADD CONSTRAINT FK_43B9FE3C1DFA7C8F FOREIGN KEY (revision_id) REFERENCES revision (id)');
  24. //        $this->addSql('CREATE UNIQUE INDEX UNIQ_43B9FE3C1DFA7C8F ON step (revision_id)');
  25. //        $this->addSql('CREATE INDEX deleted_at_idx ON step (deleted_at)');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('CREATE TABLE t_step (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, locale VARCHAR(8) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_F9CF974E2C2AC5D3 (translatable_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  31.         $this->addSql('ALTER TABLE t_step ADD CONSTRAINT FK_F9CF974E2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES step (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
  32.         $this->addSql('ALTER TABLE step DROP FOREIGN KEY FK_43B9FE3C1DFA7C8F');
  33.         $this->addSql('DROP INDEX UNIQ_43B9FE3C1DFA7C8F ON step');
  34.         $this->addSql('DROP INDEX deleted_at_idx ON step');
  35.         $this->addSql('ALTER TABLE step ADD url VARCHAR(255) NOT NULL, ADD notation INT NOT NULL, CHANGE revision_id photo_id INT DEFAULT NULL');
  36.         $this->addSql('ALTER TABLE step ADD CONSTRAINT FK_43B9FE3C7E9E4C8C FOREIGN KEY (photo_id) REFERENCES media (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
  37.         $this->addSql('CREATE INDEX IDX_43B9FE3C7E9E4C8C ON step (photo_id)');
  38.     }
  39. }