From c20512ed5bde39d5d4f2b838eeefe1a5613ae4ce Mon Sep 17 00:00:00 2001 From: jkindly Date: Thu, 4 Jul 2024 10:08:35 +0200 Subject: [PATCH] OP-323: remove drop table statement from migration --- src/Migrations/Version20240703083513.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Migrations/Version20240703083513.php b/src/Migrations/Version20240703083513.php index 3e4e9105..3d233269 100644 --- a/src/Migrations/Version20240703083513.php +++ b/src/Migrations/Version20240703083513.php @@ -17,23 +17,17 @@ final class Version20240703083513 extends AbstractMigration { public function getDescription(): string { - return 'This migration removes media products and move name from media translation to media directly.'; + return 'This migration move name from media translation to media directly.'; } public function up(Schema $schema): void { - $this->addSql('ALTER TABLE bitbag_cms_media_products DROP FOREIGN KEY FK_91A7DAC24584665A'); - $this->addSql('ALTER TABLE bitbag_cms_media_products DROP FOREIGN KEY FK_91A7DAC2EA9FDD75'); - $this->addSql('DROP TABLE bitbag_cms_media_products'); $this->addSql('ALTER TABLE bitbag_cms_media ADD name VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE bitbag_cms_media_translation DROP name'); } public function down(Schema $schema): void { - $this->addSql('CREATE TABLE bitbag_cms_media_products (media_id INT NOT NULL, product_id INT NOT NULL, INDEX IDX_91A7DAC24584665A (product_id), INDEX IDX_91A7DAC2EA9FDD75 (media_id), PRIMARY KEY(media_id, product_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); - $this->addSql('ALTER TABLE bitbag_cms_media_products ADD CONSTRAINT FK_91A7DAC24584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); - $this->addSql('ALTER TABLE bitbag_cms_media_products ADD CONSTRAINT FK_91A7DAC2EA9FDD75 FOREIGN KEY (media_id) REFERENCES bitbag_cms_media (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE bitbag_cms_media DROP name'); $this->addSql('ALTER TABLE bitbag_cms_media_translation ADD name VARCHAR(255) DEFAULT NULL'); }