<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220107025825 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$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');
$this->addSql('DROP INDEX alert_translation_idx ON alert_translations');
$this->addSql('ALTER TABLE alert_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
$this->addSql('ALTER TABLE alert_translations ADD CONSTRAINT FK_4E677FD232D562B FOREIGN KEY (object_id) REFERENCES alert (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_4E677FD232D562B ON alert_translations (object_id)');
$this->addSql('CREATE INDEX alert_translation_idx ON alert_translations (locale, object_id, field)');
$this->addSql('DROP INDEX banner_translation_idx ON banner_translations');
$this->addSql('ALTER TABLE banner_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
$this->addSql('ALTER TABLE banner_translations ADD CONSTRAINT FK_F8B8D8B232D562B FOREIGN KEY (object_id) REFERENCES banner (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_F8B8D8B232D562B ON banner_translations (object_id)');
$this->addSql('CREATE INDEX banner_translation_idx ON banner_translations (locale, object_id, field)');
$this->addSql('DROP INDEX behind_translation_idx ON behind_translations');
$this->addSql('ALTER TABLE behind_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
$this->addSql('ALTER TABLE behind_translations ADD CONSTRAINT FK_1E6AC4D4232D562B FOREIGN KEY (object_id) REFERENCES behind (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_1E6AC4D4232D562B ON behind_translations (object_id)');
$this->addSql('CREATE INDEX behind_translation_idx ON behind_translations (locale, object_id, field)');
$this->addSql('DROP INDEX classification_translation_idx ON classification_translations');
$this->addSql('ALTER TABLE classification_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
$this->addSql('ALTER TABLE classification_translations ADD CONSTRAINT FK_FDE2FA6F232D562B FOREIGN KEY (object_id) REFERENCES classification (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_FDE2FA6F232D562B ON classification_translations (object_id)');
$this->addSql('CREATE INDEX classification_translation_idx ON classification_translations (locale, object_id, field)');
$this->addSql('DROP INDEX gallery_translation_idx ON gallery_translations');
$this->addSql('ALTER TABLE gallery_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
$this->addSql('ALTER TABLE gallery_translations ADD CONSTRAINT FK_5A57D067232D562B FOREIGN KEY (object_id) REFERENCES gallery (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_5A57D067232D562B ON gallery_translations (object_id)');
$this->addSql('CREATE INDEX gallery_translation_idx ON gallery_translations (locale, object_id, field)');
$this->addSql('DROP INDEX interview_translation_idx ON interview_translations');
$this->addSql('ALTER TABLE interview_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
$this->addSql('ALTER TABLE interview_translations ADD CONSTRAINT FK_A6D998F2232D562B FOREIGN KEY (object_id) REFERENCES interview (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_A6D998F2232D562B ON interview_translations (object_id)');
$this->addSql('CREATE INDEX interview_translation_idx ON interview_translations (locale, object_id, field)');
$this->addSql('DROP INDEX program_translation_idx ON program_translations');
$this->addSql('ALTER TABLE program_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
$this->addSql('ALTER TABLE program_translations ADD CONSTRAINT FK_851229A0232D562B FOREIGN KEY (object_id) REFERENCES program (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_851229A0232D562B ON program_translations (object_id)');
$this->addSql('CREATE INDEX program_translation_idx ON program_translations (locale, object_id, field)');
$this->addSql('DROP INDEX streaming_translation_idx ON streaming_translations');
$this->addSql('ALTER TABLE streaming_translations ADD object_id INT DEFAULT NULL, DROP object_class, DROP foreign_key');
$this->addSql('ALTER TABLE streaming_translations ADD CONSTRAINT FK_48742C8E232D562B FOREIGN KEY (object_id) REFERENCES streaming (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_48742C8E232D562B ON streaming_translations (object_id)');
$this->addSql('CREATE INDEX streaming_translation_idx ON streaming_translations (locale, object_id, field)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE ext_translations');
$this->addSql('ALTER TABLE alert_translations DROP FOREIGN KEY FK_4E677FD232D562B');
$this->addSql('DROP INDEX IDX_4E677FD232D562B ON alert_translations');
$this->addSql('DROP INDEX alert_translation_idx ON alert_translations');
$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');
$this->addSql('CREATE INDEX alert_translation_idx ON alert_translations (locale, object_class, field, foreign_key)');
$this->addSql('ALTER TABLE banner_translations DROP FOREIGN KEY FK_F8B8D8B232D562B');
$this->addSql('DROP INDEX IDX_F8B8D8B232D562B ON banner_translations');
$this->addSql('DROP INDEX banner_translation_idx ON banner_translations');
$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');
$this->addSql('CREATE INDEX banner_translation_idx ON banner_translations (locale, object_class, field, foreign_key)');
$this->addSql('ALTER TABLE behind_translations DROP FOREIGN KEY FK_1E6AC4D4232D562B');
$this->addSql('DROP INDEX IDX_1E6AC4D4232D562B ON behind_translations');
$this->addSql('DROP INDEX behind_translation_idx ON behind_translations');
$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');
$this->addSql('CREATE INDEX behind_translation_idx ON behind_translations (locale, object_class, field, foreign_key)');
$this->addSql('ALTER TABLE classification_translations DROP FOREIGN KEY FK_FDE2FA6F232D562B');
$this->addSql('DROP INDEX IDX_FDE2FA6F232D562B ON classification_translations');
$this->addSql('DROP INDEX classification_translation_idx ON classification_translations');
$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');
$this->addSql('CREATE INDEX classification_translation_idx ON classification_translations (locale, object_class, field, foreign_key)');
$this->addSql('ALTER TABLE gallery_translations DROP FOREIGN KEY FK_5A57D067232D562B');
$this->addSql('DROP INDEX IDX_5A57D067232D562B ON gallery_translations');
$this->addSql('DROP INDEX gallery_translation_idx ON gallery_translations');
$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');
$this->addSql('CREATE INDEX gallery_translation_idx ON gallery_translations (locale, object_class, field, foreign_key)');
$this->addSql('ALTER TABLE interview_translations DROP FOREIGN KEY FK_A6D998F2232D562B');
$this->addSql('DROP INDEX IDX_A6D998F2232D562B ON interview_translations');
$this->addSql('DROP INDEX interview_translation_idx ON interview_translations');
$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');
$this->addSql('CREATE INDEX interview_translation_idx ON interview_translations (locale, object_class, field, foreign_key)');
$this->addSql('ALTER TABLE program_translations DROP FOREIGN KEY FK_851229A0232D562B');
$this->addSql('DROP INDEX IDX_851229A0232D562B ON program_translations');
$this->addSql('DROP INDEX program_translation_idx ON program_translations');
$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');
$this->addSql('CREATE INDEX program_translation_idx ON program_translations (locale, object_class, field, foreign_key)');
$this->addSql('ALTER TABLE streaming_translations DROP FOREIGN KEY FK_48742C8E232D562B');
$this->addSql('DROP INDEX IDX_48742C8E232D562B ON streaming_translations');
$this->addSql('DROP INDEX streaming_translation_idx ON streaming_translations');
$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');
$this->addSql('CREATE INDEX streaming_translation_idx ON streaming_translations (locale, object_class, field, foreign_key)');
}
}