Skip to content

Commit

Permalink
SQL script fix product
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Dec 13, 2019
1 parent 4d803ef commit 03a762a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/product.sql
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ ALTER TABLE `catalog_product_link`
DROP INDEX `CATALOG_PRODUCT_LINK_LINK_TYPE_ID_PRODUCT_ID_LINKED_PRODUCT_ID`,
DROP COLUMN `product_id`,
CHANGE COLUMN `new_product_id` `product_id` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Product ID',
ADD INDEX CATALOG_PRODUCT_LINK_PRODUCT_ID (`product_id`),
ADD INDEX `CATALOG_PRODUCT_LINK_PRODUCT_ID` (`product_id`),
ADD CONSTRAINT `CATALOG_PRODUCT_LINK_LINK_TYPE_ID_PRODUCT_ID_LINKED_PRODUCT_ID` UNIQUE KEY (`link_type_id`,`product_id`,`linked_product_id`);

-- ---------------
Expand Down Expand Up @@ -332,22 +332,24 @@ ALTER TABLE `catalog_product_entity_varchar`
-- Gallery value to entity
ALTER TABLE `catalog_product_entity_media_gallery_value_to_entity`
DROP FOREIGN KEY `CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_ROW_ID_CAT_PRD_ENTT_ROW_ID`,
DROP CONSTRAINT `CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID`,
DROP INDEX `CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID`,
ADD CONSTRAINT `CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID` UNIQUE KEY (`value_id`,`entity_id`),
DROP COLUMN `row_id`;

-- Gallery value
ALTER TABLE `catalog_product_entity_media_gallery_value`
DROP FOREIGN KEY `CAT_PRD_ENTT_MDA_GLR_VAL_ROW_ID_CAT_PRD_ENTT_ROW_ID`,
DROP INDEX `CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_VALUE_ENTITY_ID`,
DROP INDEX `CAT_PRD_ENTT_MDA_GLR_VAL_ENTT_ID_VAL_ID_STORE_ID`,
ADD INDEX `CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_VALUE_ENTITY_ID` (`entity_id`),
ADD CONSTRAINT `CAT_PRD_ENTT_MDA_GLR_VAL_ENTT_ID_VAL_ID_STORE_ID` UNIQUE KEY (`entity_id`,`value_id`,`store_id`),
DROP COLUMN `row_id`;

-- Gallery
ALTER TABLE `catalog_product_entity_gallery`
DROP FOREIGN KEY `CAT_PRD_ENTT_GLR_ROW_ID_CAT_PRD_ENTT_ROW_ID`,
DROP INDEX `CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY_ID`,
DROP INDEX `CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY_ID_ATTRIBUTE_ID_STORE_ID`,
ADD INDEX `CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY_ID` (`entity_id`),
ADD CONSTRAINT `CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` UNIQUE KEY (`entity_id`,`attribute_id`,`store_id`),
DROP COLUMN `row_id`;

Expand Down

0 comments on commit 03a762a

Please sign in to comment.