Skip to content

Commit

Permalink
OP-323: remove drop table statement from migration
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Jul 4, 2024
1 parent 39d3e23 commit c20512e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/Migrations/Version20240703083513.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit c20512e

Please sign in to comment.