- Posts: 3
- Thank you received: 0
PK for product_related table
15 years 7 months ago - 15 years 7 months ago #8605
by ipv6wiz
PK for product_related table was created by ipv6wiz
The Primary Key for the jos_hikashop_product_related table needs to include product_related_type because this table is used for more than one type. With out the type being added to the PK the INSERT IGNORE will not add rows where the product_id and product_related_id are already in use for a different type.
Last edit: 15 years 7 months ago by ipv6wiz. Reason: Typos
Please Log in or Create an account to join the conversation.
15 years 7 months ago #8618
by nicolas
Replied by nicolas on topic Re: PK for product_related table
You're right. We'll add that query in next release to change the primary so that you can have other types in that table without conflicts:
ALTER TABLE `#__hikashop_product_related` DROP PRIMARY KEY ,
ADD PRIMARY KEY ( `product_id` , `product_related_id` , `product_related_type` )
ALTER TABLE `#__hikashop_product_related` DROP PRIMARY KEY ,
ADD PRIMARY KEY ( `product_id` , `product_related_id` , `product_related_type` )
Please Log in or Create an account to join the conversation.
Time to create page: 0.179 seconds