diff --git a/src/Migrations/Version20240903103926.php b/src/Migrations/Version20240903103926.php new file mode 100644 index 00000000..5b466df3 --- /dev/null +++ b/src/Migrations/Version20240903103926.php @@ -0,0 +1,252 @@ +addSql('DROP INDEX uniq_321c84cf77153098 ON sylius_cms_block'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_9D2248BC77153098 ON sylius_cms_block (code)'); + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602F72F5A1AA'); + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602FE9ED820C'); + $this->addSql('DROP INDEX idx_8417b073e9ed820c ON sylius_cms_block_channels'); + $this->addSql('CREATE INDEX IDX_7026602FE9ED820C ON sylius_cms_block_channels (block_id)'); + $this->addSql('DROP INDEX idx_8417b07372f5a1aa ON sylius_cms_block_channels'); + $this->addSql('CREATE INDEX IDX_7026602F72F5A1AA ON sylius_cms_block_channels (channel_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602FE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE559DFD1'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE9ED820C'); + $this->addSql('DROP INDEX idx_e1f907bae9ed820c ON sylius_cms_block_locales'); + $this->addSql('CREATE INDEX IDX_49C0AACE9ED820C ON sylius_cms_block_locales (block_id)'); + $this->addSql('DROP INDEX idx_e1f907bae559dfd1 ON sylius_cms_block_locales'); + $this->addSql('CREATE INDEX IDX_49C0AACE559DFD1 ON sylius_cms_block_locales (locale_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE559DFD1 FOREIGN KEY (locale_id) REFERENCES sylius_locale (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C3E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C34584665A'); + $this->addSql('DROP INDEX idx_c4b9089fe9ed820c ON sylius_cms_block_products'); + $this->addSql('CREATE INDEX IDX_3088D8C3E9ED820C ON sylius_cms_block_products (block_id)'); + $this->addSql('DROP INDEX idx_c4b9089f4584665a ON sylius_cms_block_products'); + $this->addSql('CREATE INDEX IDX_3088D8C34584665A ON sylius_cms_block_products (product_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C3E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C34584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03DE13F470'); + $this->addSql('DROP INDEX idx_e324c6cee9ed820c ON sylius_cms_block_taxons'); + $this->addSql('CREATE INDEX IDX_5397DD03E9ED820C ON sylius_cms_block_taxons (block_id)'); + $this->addSql('DROP INDEX idx_e324c6cede13f470 ON sylius_cms_block_taxons'); + $this->addSql('CREATE INDEX IDX_5397DD03DE13F470 ON sylius_cms_block_taxons (taxon_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03DE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEDE13F470'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEE9ED820C'); + $this->addSql('DROP INDEX idx_daa9dd18e9ed820c ON sylius_cms_block_products_in_taxons'); + $this->addSql('CREATE INDEX IDX_B4D0B7CEE9ED820C ON sylius_cms_block_products_in_taxons (block_id)'); + $this->addSql('DROP INDEX idx_daa9dd18de13f470 ON sylius_cms_block_products_in_taxons'); + $this->addSql('CREATE INDEX IDX_B4D0B7CEDE13F470 ON sylius_cms_block_products_in_taxons (taxon_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEDE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DC4663E4'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DE9ED820C'); + $this->addSql('DROP INDEX idx_d899efa7e9ed820c ON sylius_cms_content_configuration'); + $this->addSql('CREATE INDEX IDX_BB97608DE9ED820C ON sylius_cms_content_configuration (block_id)'); + $this->addSql('DROP INDEX idx_d899efa7c4663e4 ON sylius_cms_content_configuration'); + $this->addSql('CREATE INDEX IDX_BB97608DC4663E4 ON sylius_cms_content_configuration (page_id)'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id)'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id)'); + $this->addSql('DROP INDEX uniq_db2bb2e177153098 ON sylius_cms_media'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_74157E9277153098 ON sylius_cms_media (code)'); + $this->addSql('DROP INDEX uniq_db2bb2e1b548b0f ON sylius_cms_media'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_74157E92B548B0F ON sylius_cms_media (path)'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B27272F5A1AA'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B272EA9FDD75'); + $this->addSql('DROP INDEX idx_d109622eea9fdd75 ON sylius_cms_media_channels'); + $this->addSql('CREATE INDEX IDX_2538B272EA9FDD75 ON sylius_cms_media_channels (media_id)'); + $this->addSql('DROP INDEX idx_d109622e72f5a1aa ON sylius_cms_media_channels'); + $this->addSql('CREATE INDEX IDX_2538B27272F5A1AA ON sylius_cms_media_channels (channel_id)'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B27272F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B272EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_translation DROP FOREIGN KEY FK_AAAC4A922C2AC5D3'); + $this->addSql('DROP INDEX idx_1fec58972c2ac5d3 ON sylius_cms_media_translation'); + $this->addSql('CREATE INDEX IDX_AAAC4A922C2AC5D3 ON sylius_cms_media_translation (translatable_id)'); + $this->addSql('DROP INDEX bitbag_cms_media_translation_uniq_trans ON sylius_cms_media_translation'); + $this->addSql('CREATE UNIQUE INDEX sylius_cms_media_translation_uniq_trans ON sylius_cms_media_translation (translatable_id, locale)'); + $this->addSql('ALTER TABLE sylius_cms_media_translation ADD CONSTRAINT FK_AAAC4A922C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page DROP FOREIGN KEY FK_2C2740B2F56F16CF'); + $this->addSql('DROP INDEX uniq_18f07f1b77153098 ON sylius_cms_page'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_2C2740B277153098 ON sylius_cms_page (code)'); + $this->addSql('DROP INDEX idx_18f07f1bf56f16cf ON sylius_cms_page'); + $this->addSql('CREATE INDEX IDX_2C2740B2F56F16CF ON sylius_cms_page (teaser_image_id)'); + $this->addSql('ALTER TABLE sylius_cms_page ADD CONSTRAINT FK_2C2740B2F56F16CF FOREIGN KEY (teaser_image_id) REFERENCES sylius_cms_media (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7F72F5A1AA'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7FC4663E4'); + $this->addSql('DROP INDEX idx_dca4269c4663e4 ON sylius_cms_page_channels'); + $this->addSql('CREATE INDEX IDX_E8AF4F7FC4663E4 ON sylius_cms_page_channels (page_id)'); + $this->addSql('DROP INDEX idx_dca426972f5a1aa ON sylius_cms_page_channels'); + $this->addSql('CREATE INDEX IDX_E8AF4F7F72F5A1AA ON sylius_cms_page_channels (channel_id)'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7FC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_translation DROP FOREIGN KEY FK_6D0D401B2C2AC5D3'); + $this->addSql('DROP INDEX idx_fdd074a62c2ac5d3 ON sylius_cms_page_translation'); + $this->addSql('CREATE INDEX IDX_6D0D401B2C2AC5D3 ON sylius_cms_page_translation (translatable_id)'); + $this->addSql('DROP INDEX bitbag_cms_page_translation_uniq_trans ON sylius_cms_page_translation'); + $this->addSql('CREATE UNIQUE INDEX sylius_cms_page_translation_uniq_trans ON sylius_cms_page_translation (translatable_id, locale)'); + $this->addSql('ALTER TABLE sylius_cms_page_translation ADD CONSTRAINT FK_6D0D401B2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('DROP INDEX uniq_421d079777153098 ON sylius_cms_section'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_D4DD0C0777153098 ON sylius_cms_section (code)'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8C4663E4'); + $this->addSql('DROP INDEX idx_c96225eed823e37a ON sylius_cms_section_pages'); + $this->addSql('CREATE INDEX IDX_2C0728F8D823E37A ON sylius_cms_section_pages (section_id)'); + $this->addSql('DROP INDEX idx_c96225eec4663e4 ON sylius_cms_section_pages'); + $this->addSql('CREATE INDEX IDX_2C0728F8C4663E4 ON sylius_cms_section_pages (page_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8C4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928E9ED820C'); + $this->addSql('DROP INDEX idx_a9d9c974d823e37a ON sylius_cms_section_blocks'); + $this->addSql('CREATE INDEX IDX_5DE81928D823E37A ON sylius_cms_section_blocks (section_id)'); + $this->addSql('DROP INDEX idx_a9d9c974e9ed820c ON sylius_cms_section_blocks'); + $this->addSql('CREATE INDEX IDX_5DE81928E9ED820C ON sylius_cms_section_blocks (block_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81EA9FDD75'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81D823E37A'); + $this->addSql('DROP INDEX idx_833a6197d823e37a ON sylius_cms_section_media'); + $this->addSql('CREATE INDEX IDX_665F6C81D823E37A ON sylius_cms_section_media (section_id)'); + $this->addSql('DROP INDEX idx_833a6197ea9fdd75 ON sylius_cms_section_media'); + $this->addSql('CREATE INDEX IDX_665F6C81EA9FDD75 ON sylius_cms_section_media (media_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons DROP FOREIGN KEY FK_B4D0B7CEDE13F470'); + $this->addSql('DROP INDEX idx_b4d0b7cee9ed820c ON sylius_cms_block_products_in_taxons'); + $this->addSql('CREATE INDEX IDX_DAA9DD18E9ED820C ON sylius_cms_block_products_in_taxons (block_id)'); + $this->addSql('DROP INDEX idx_b4d0b7cede13f470 ON sylius_cms_block_products_in_taxons'); + $this->addSql('CREATE INDEX IDX_DAA9DD18DE13F470 ON sylius_cms_block_products_in_taxons (taxon_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products_in_taxons ADD CONSTRAINT FK_B4D0B7CEDE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B272EA9FDD75'); + $this->addSql('ALTER TABLE sylius_cms_media_channels DROP FOREIGN KEY FK_2538B27272F5A1AA'); + $this->addSql('DROP INDEX idx_2538b27272f5a1aa ON sylius_cms_media_channels'); + $this->addSql('CREATE INDEX IDX_D109622E72F5A1AA ON sylius_cms_media_channels (channel_id)'); + $this->addSql('DROP INDEX idx_2538b272ea9fdd75 ON sylius_cms_media_channels'); + $this->addSql('CREATE INDEX IDX_D109622EEA9FDD75 ON sylius_cms_media_channels (media_id)'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B272EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_channels ADD CONSTRAINT FK_2538B27272F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_pages DROP FOREIGN KEY FK_2C0728F8C4663E4'); + $this->addSql('DROP INDEX idx_2c0728f8d823e37a ON sylius_cms_section_pages'); + $this->addSql('CREATE INDEX IDX_C96225EED823E37A ON sylius_cms_section_pages (section_id)'); + $this->addSql('DROP INDEX idx_2c0728f8c4663e4 ON sylius_cms_section_pages'); + $this->addSql('CREATE INDEX IDX_C96225EEC4663E4 ON sylius_cms_section_pages (page_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_pages ADD CONSTRAINT FK_2C0728F8C4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('DROP INDEX uniq_74157e9277153098 ON sylius_cms_media'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_DB2BB2E177153098 ON sylius_cms_media (code)'); + $this->addSql('DROP INDEX uniq_74157e92b548b0f ON sylius_cms_media'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_DB2BB2E1B548B0F ON sylius_cms_media (path)'); + $this->addSql('ALTER TABLE sylius_cms_page DROP FOREIGN KEY FK_2C2740B2F56F16CF'); + $this->addSql('DROP INDEX idx_2c2740b2f56f16cf ON sylius_cms_page'); + $this->addSql('CREATE INDEX IDX_18F07F1BF56F16CF ON sylius_cms_page (teaser_image_id)'); + $this->addSql('DROP INDEX uniq_2c2740b277153098 ON sylius_cms_page'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_18F07F1B77153098 ON sylius_cms_page (code)'); + $this->addSql('ALTER TABLE sylius_cms_page ADD CONSTRAINT FK_2C2740B2F56F16CF FOREIGN KEY (teaser_image_id) REFERENCES sylius_cms_media (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602FE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_channels DROP FOREIGN KEY FK_7026602F72F5A1AA'); + $this->addSql('DROP INDEX idx_7026602f72f5a1aa ON sylius_cms_block_channels'); + $this->addSql('CREATE INDEX IDX_8417B07372F5A1AA ON sylius_cms_block_channels (channel_id)'); + $this->addSql('DROP INDEX idx_7026602fe9ed820c ON sylius_cms_block_channels'); + $this->addSql('CREATE INDEX IDX_8417B073E9ED820C ON sylius_cms_block_channels (block_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602FE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_channels ADD CONSTRAINT FK_7026602F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C3E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_products DROP FOREIGN KEY FK_3088D8C34584665A'); + $this->addSql('DROP INDEX idx_3088d8c3e9ed820c ON sylius_cms_block_products'); + $this->addSql('CREATE INDEX IDX_C4B9089FE9ED820C ON sylius_cms_block_products (block_id)'); + $this->addSql('DROP INDEX idx_3088d8c34584665a ON sylius_cms_block_products'); + $this->addSql('CREATE INDEX IDX_C4B9089F4584665A ON sylius_cms_block_products (product_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C3E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_products ADD CONSTRAINT FK_3088D8C34584665A FOREIGN KEY (product_id) REFERENCES sylius_product (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_locales DROP FOREIGN KEY FK_49C0AACE559DFD1'); + $this->addSql('DROP INDEX idx_49c0aace9ed820c ON sylius_cms_block_locales'); + $this->addSql('CREATE INDEX IDX_E1F907BAE9ED820C ON sylius_cms_block_locales (block_id)'); + $this->addSql('DROP INDEX idx_49c0aace559dfd1 ON sylius_cms_block_locales'); + $this->addSql('CREATE INDEX IDX_E1F907BAE559DFD1 ON sylius_cms_block_locales (locale_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_locales ADD CONSTRAINT FK_49C0AACE559DFD1 FOREIGN KEY (locale_id) REFERENCES sylius_locale (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_media_translation DROP FOREIGN KEY FK_AAAC4A922C2AC5D3'); + $this->addSql('DROP INDEX idx_aaac4a922c2ac5d3 ON sylius_cms_media_translation'); + $this->addSql('CREATE INDEX IDX_1FEC58972C2AC5D3 ON sylius_cms_media_translation (translatable_id)'); + $this->addSql('DROP INDEX sylius_cms_media_translation_uniq_trans ON sylius_cms_media_translation'); + $this->addSql('CREATE UNIQUE INDEX bitbag_cms_media_translation_uniq_trans ON sylius_cms_media_translation (translatable_id, locale)'); + $this->addSql('ALTER TABLE sylius_cms_media_translation ADD CONSTRAINT FK_AAAC4A922C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7FC4663E4'); + $this->addSql('ALTER TABLE sylius_cms_page_channels DROP FOREIGN KEY FK_E8AF4F7F72F5A1AA'); + $this->addSql('DROP INDEX idx_e8af4f7fc4663e4 ON sylius_cms_page_channels'); + $this->addSql('CREATE INDEX IDX_DCA4269C4663E4 ON sylius_cms_page_channels (page_id)'); + $this->addSql('DROP INDEX idx_e8af4f7f72f5a1aa ON sylius_cms_page_channels'); + $this->addSql('CREATE INDEX IDX_DCA426972F5A1AA ON sylius_cms_page_channels (channel_id)'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7FC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_channels ADD CONSTRAINT FK_E8AF4F7F72F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DE9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration DROP FOREIGN KEY FK_BB97608DC4663E4'); + $this->addSql('DROP INDEX idx_bb97608de9ed820c ON sylius_cms_content_configuration'); + $this->addSql('CREATE INDEX IDX_D899EFA7E9ED820C ON sylius_cms_content_configuration (block_id)'); + $this->addSql('DROP INDEX idx_bb97608dc4663e4 ON sylius_cms_content_configuration'); + $this->addSql('CREATE INDEX IDX_D899EFA7C4663E4 ON sylius_cms_content_configuration (page_id)'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DE9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id)'); + $this->addSql('ALTER TABLE sylius_cms_content_configuration ADD CONSTRAINT FK_BB97608DC4663E4 FOREIGN KEY (page_id) REFERENCES sylius_cms_page (id)'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_media DROP FOREIGN KEY FK_665F6C81EA9FDD75'); + $this->addSql('DROP INDEX idx_665f6c81ea9fdd75 ON sylius_cms_section_media'); + $this->addSql('CREATE INDEX IDX_833A6197EA9FDD75 ON sylius_cms_section_media (media_id)'); + $this->addSql('DROP INDEX idx_665f6c81d823e37a ON sylius_cms_section_media'); + $this->addSql('CREATE INDEX IDX_833A6197D823E37A ON sylius_cms_section_media (section_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_media ADD CONSTRAINT FK_665F6C81EA9FDD75 FOREIGN KEY (media_id) REFERENCES sylius_cms_media (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928D823E37A'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks DROP FOREIGN KEY FK_5DE81928E9ED820C'); + $this->addSql('DROP INDEX idx_5de81928d823e37a ON sylius_cms_section_blocks'); + $this->addSql('CREATE INDEX IDX_A9D9C974D823E37A ON sylius_cms_section_blocks (section_id)'); + $this->addSql('DROP INDEX idx_5de81928e9ed820c ON sylius_cms_section_blocks'); + $this->addSql('CREATE INDEX IDX_A9D9C974E9ED820C ON sylius_cms_section_blocks (block_id)'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928D823E37A FOREIGN KEY (section_id) REFERENCES sylius_cms_section (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_section_blocks ADD CONSTRAINT FK_5DE81928E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_page_translation DROP FOREIGN KEY FK_6D0D401B2C2AC5D3'); + $this->addSql('DROP INDEX sylius_cms_page_translation_uniq_trans ON sylius_cms_page_translation'); + $this->addSql('CREATE UNIQUE INDEX bitbag_cms_page_translation_uniq_trans ON sylius_cms_page_translation (translatable_id, locale)'); + $this->addSql('DROP INDEX idx_6d0d401b2c2ac5d3 ON sylius_cms_page_translation'); + $this->addSql('CREATE INDEX IDX_FDD074A62C2AC5D3 ON sylius_cms_page_translation (translatable_id)'); + $this->addSql('ALTER TABLE sylius_cms_page_translation ADD CONSTRAINT FK_6D0D401B2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES sylius_cms_page (id) ON DELETE CASCADE'); + $this->addSql('DROP INDEX uniq_d4dd0c0777153098 ON sylius_cms_section'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_421D079777153098 ON sylius_cms_section (code)'); + $this->addSql('DROP INDEX uniq_9d2248bc77153098 ON sylius_cms_block'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_321C84CF77153098 ON sylius_cms_block (code)'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03E9ED820C'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons DROP FOREIGN KEY FK_5397DD03DE13F470'); + $this->addSql('DROP INDEX idx_5397dd03de13f470 ON sylius_cms_block_taxons'); + $this->addSql('CREATE INDEX IDX_E324C6CEDE13F470 ON sylius_cms_block_taxons (taxon_id)'); + $this->addSql('DROP INDEX idx_5397dd03e9ed820c ON sylius_cms_block_taxons'); + $this->addSql('CREATE INDEX IDX_E324C6CEE9ED820C ON sylius_cms_block_taxons (block_id)'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03E9ED820C FOREIGN KEY (block_id) REFERENCES sylius_cms_block (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE sylius_cms_block_taxons ADD CONSTRAINT FK_5397DD03DE13F470 FOREIGN KEY (taxon_id) REFERENCES sylius_taxon (id) ON DELETE CASCADE'); + } +}