migrations/Version20220107025825.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 Version20220107025825 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('CREATE TABLE ext_translations (id INT AUTO_INCREMENT NOT NULL, locale VARCHAR(8) NOT NULL, object_class VARCHAR(191) NOT NULL, field VARCHAR(32) NOT NULL, foreign_key VARCHAR(64) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX translations_lookup_idx (locale, object_class, foreign_key), UNIQUE INDEX lookup_unique_idx (locale, object_class, field, foreign_key), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC');
  19.         $this->addSql('DROP INDEX alert_translation_idx ON alert_translations');
  20.         $this->addSql('ALTER TABLE alert_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
  21.         $this->addSql('ALTER TABLE alert_translations ADD CONSTRAINT FK_4E677FD232D562B FOREIGN KEY (object_id) REFERENCES alert (id) ON DELETE CASCADE');
  22.         $this->addSql('CREATE INDEX IDX_4E677FD232D562B ON alert_translations (object_id)');
  23.         $this->addSql('CREATE INDEX alert_translation_idx ON alert_translations (locale, object_id, field)');
  24.         $this->addSql('DROP INDEX banner_translation_idx ON banner_translations');
  25.         $this->addSql('ALTER TABLE banner_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
  26.         $this->addSql('ALTER TABLE banner_translations ADD CONSTRAINT FK_F8B8D8B232D562B FOREIGN KEY (object_id) REFERENCES banner (id) ON DELETE CASCADE');
  27.         $this->addSql('CREATE INDEX IDX_F8B8D8B232D562B ON banner_translations (object_id)');
  28.         $this->addSql('CREATE INDEX banner_translation_idx ON banner_translations (locale, object_id, field)');
  29.         $this->addSql('DROP INDEX behind_translation_idx ON behind_translations');
  30.         $this->addSql('ALTER TABLE behind_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
  31.         $this->addSql('ALTER TABLE behind_translations ADD CONSTRAINT FK_1E6AC4D4232D562B FOREIGN KEY (object_id) REFERENCES behind (id) ON DELETE CASCADE');
  32.         $this->addSql('CREATE INDEX IDX_1E6AC4D4232D562B ON behind_translations (object_id)');
  33.         $this->addSql('CREATE INDEX behind_translation_idx ON behind_translations (locale, object_id, field)');
  34.         $this->addSql('DROP INDEX classification_translation_idx ON classification_translations');
  35.         $this->addSql('ALTER TABLE classification_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
  36.         $this->addSql('ALTER TABLE classification_translations ADD CONSTRAINT FK_FDE2FA6F232D562B FOREIGN KEY (object_id) REFERENCES classification (id) ON DELETE CASCADE');
  37.         $this->addSql('CREATE INDEX IDX_FDE2FA6F232D562B ON classification_translations (object_id)');
  38.         $this->addSql('CREATE INDEX classification_translation_idx ON classification_translations (locale, object_id, field)');
  39.         $this->addSql('DROP INDEX gallery_translation_idx ON gallery_translations');
  40.         $this->addSql('ALTER TABLE gallery_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
  41.         $this->addSql('ALTER TABLE gallery_translations ADD CONSTRAINT FK_5A57D067232D562B FOREIGN KEY (object_id) REFERENCES gallery (id) ON DELETE CASCADE');
  42.         $this->addSql('CREATE INDEX IDX_5A57D067232D562B ON gallery_translations (object_id)');
  43.         $this->addSql('CREATE INDEX gallery_translation_idx ON gallery_translations (locale, object_id, field)');
  44.         $this->addSql('DROP INDEX interview_translation_idx ON interview_translations');
  45.         $this->addSql('ALTER TABLE interview_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
  46.         $this->addSql('ALTER TABLE interview_translations ADD CONSTRAINT FK_A6D998F2232D562B FOREIGN KEY (object_id) REFERENCES interview (id) ON DELETE CASCADE');
  47.         $this->addSql('CREATE INDEX IDX_A6D998F2232D562B ON interview_translations (object_id)');
  48.         $this->addSql('CREATE INDEX interview_translation_idx ON interview_translations (locale, object_id, field)');
  49.         $this->addSql('DROP INDEX program_translation_idx ON program_translations');
  50.         $this->addSql('ALTER TABLE program_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
  51.         $this->addSql('ALTER TABLE program_translations ADD CONSTRAINT FK_851229A0232D562B FOREIGN KEY (object_id) REFERENCES program (id) ON DELETE CASCADE');
  52.         $this->addSql('CREATE INDEX IDX_851229A0232D562B ON program_translations (object_id)');
  53.         $this->addSql('CREATE INDEX program_translation_idx ON program_translations (locale, object_id, field)');
  54.         $this->addSql('DROP INDEX streaming_translation_idx ON streaming_translations');
  55.         $this->addSql('ALTER TABLE streaming_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
  56.         $this->addSql('ALTER TABLE streaming_translations ADD CONSTRAINT FK_48742C8E232D562B FOREIGN KEY (object_id) REFERENCES streaming (id) ON DELETE CASCADE');
  57.         $this->addSql('CREATE INDEX IDX_48742C8E232D562B ON streaming_translations (object_id)');
  58.         $this->addSql('CREATE INDEX streaming_translation_idx ON streaming_translations (locale, object_id, field)');
  59.     }
  60.     public function down(Schema $schema): void
  61.     {
  62.         // this down() migration is auto-generated, please modify it to your needs
  63.         $this->addSql('DROP TABLE ext_translations');
  64.         $this->addSql('ALTER TABLE alert_translations DROP FOREIGN KEY FK_4E677FD232D562B');
  65.         $this->addSql('DROP INDEX IDX_4E677FD232D562B ON alert_translations');
  66.         $this->addSql('DROP INDEX alert_translation_idx ON alert_translations');
  67.         $this->addSql('ALTER TABLE alert_translations ADD object_class VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD foreign_key VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP object_id');
  68.         $this->addSql('CREATE INDEX alert_translation_idx ON alert_translations (locale, object_class, field, foreign_key)');
  69.         $this->addSql('ALTER TABLE banner_translations DROP FOREIGN KEY FK_F8B8D8B232D562B');
  70.         $this->addSql('DROP INDEX IDX_F8B8D8B232D562B ON banner_translations');
  71.         $this->addSql('DROP INDEX banner_translation_idx ON banner_translations');
  72.         $this->addSql('ALTER TABLE banner_translations ADD object_class VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD foreign_key VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP object_id');
  73.         $this->addSql('CREATE INDEX banner_translation_idx ON banner_translations (locale, object_class, field, foreign_key)');
  74.         $this->addSql('ALTER TABLE behind_translations DROP FOREIGN KEY FK_1E6AC4D4232D562B');
  75.         $this->addSql('DROP INDEX IDX_1E6AC4D4232D562B ON behind_translations');
  76.         $this->addSql('DROP INDEX behind_translation_idx ON behind_translations');
  77.         $this->addSql('ALTER TABLE behind_translations ADD object_class VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD foreign_key VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP object_id');
  78.         $this->addSql('CREATE INDEX behind_translation_idx ON behind_translations (locale, object_class, field, foreign_key)');
  79.         $this->addSql('ALTER TABLE classification_translations DROP FOREIGN KEY FK_FDE2FA6F232D562B');
  80.         $this->addSql('DROP INDEX IDX_FDE2FA6F232D562B ON classification_translations');
  81.         $this->addSql('DROP INDEX classification_translation_idx ON classification_translations');
  82.         $this->addSql('ALTER TABLE classification_translations ADD object_class VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD foreign_key VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP object_id');
  83.         $this->addSql('CREATE INDEX classification_translation_idx ON classification_translations (locale, object_class, field, foreign_key)');
  84.         $this->addSql('ALTER TABLE gallery_translations DROP FOREIGN KEY FK_5A57D067232D562B');
  85.         $this->addSql('DROP INDEX IDX_5A57D067232D562B ON gallery_translations');
  86.         $this->addSql('DROP INDEX gallery_translation_idx ON gallery_translations');
  87.         $this->addSql('ALTER TABLE gallery_translations ADD object_class VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD foreign_key VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP object_id');
  88.         $this->addSql('CREATE INDEX gallery_translation_idx ON gallery_translations (locale, object_class, field, foreign_key)');
  89.         $this->addSql('ALTER TABLE interview_translations DROP FOREIGN KEY FK_A6D998F2232D562B');
  90.         $this->addSql('DROP INDEX IDX_A6D998F2232D562B ON interview_translations');
  91.         $this->addSql('DROP INDEX interview_translation_idx ON interview_translations');
  92.         $this->addSql('ALTER TABLE interview_translations ADD object_class VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD foreign_key VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP object_id');
  93.         $this->addSql('CREATE INDEX interview_translation_idx ON interview_translations (locale, object_class, field, foreign_key)');
  94.         $this->addSql('ALTER TABLE program_translations DROP FOREIGN KEY FK_851229A0232D562B');
  95.         $this->addSql('DROP INDEX IDX_851229A0232D562B ON program_translations');
  96.         $this->addSql('DROP INDEX program_translation_idx ON program_translations');
  97.         $this->addSql('ALTER TABLE program_translations ADD object_class VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD foreign_key VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP object_id');
  98.         $this->addSql('CREATE INDEX program_translation_idx ON program_translations (locale, object_class, field, foreign_key)');
  99.         $this->addSql('ALTER TABLE streaming_translations DROP FOREIGN KEY FK_48742C8E232D562B');
  100.         $this->addSql('DROP INDEX IDX_48742C8E232D562B ON streaming_translations');
  101.         $this->addSql('DROP INDEX streaming_translation_idx ON streaming_translations');
  102.         $this->addSql('ALTER TABLE streaming_translations ADD object_class VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD foreign_key VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, DROP object_id');
  103.         $this->addSql('CREATE INDEX streaming_translation_idx ON streaming_translations (locale, object_class, field, foreign_key)');
  104.     }
  105. }