Skip to content

Commit

Permalink
adding PR 645 content from ShaiMagal
Browse files Browse the repository at this point in the history
  • Loading branch information
M0rgan01 committed May 7, 2024
1 parent e016367 commit 8f414ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions upgrade/sql/9.0.0.sql
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ ALTER TABLE `PREFIX_product_shop` MODIFY COLUMN `redirect_type` ENUM(
'404','410','301-product','302-product','301-category','302-category','200-displayed','404-displayed','410-displayed','default'
) NOT NULL DEFAULT 'default';

ALTER TABLE `PREFIX_accessory` DROP KEY accessory_product;
ALTER TABLE `PREFIX_accessory` ADD CONSTRAINT accessory_product PRIMARY KEY (`id_product_1`, `id_product_2`);

/* Fixing duplicates for table "accessory" where can be duplicate records from older version of PrestaShop, because of missing PRIMARY index */
CREATE TABLE `PREFIX_accessory_tmp` SELECT DISTINCT `id_product_1`, `id_product_2` FROM `PREFIX_accessory`;
ALTER TABLE `PREFIX_accessory_tmp` ADD CONSTRAINT accessory_product PRIMARY KEY (`id_product_1`, `id_product_2`);
DROP TABLE `PREFIX_accessory`;
RENAME TABLE `PREFIX_accessory_tmp` TO `PREFIX_accessory`;

ALTER TABLE `PREFIX_stock_mvt` MODIFY `id_supply_order` INT(11) DEFAULT '0';

0 comments on commit 8f414ea

Please sign in to comment.