Project

General

Profile

Actions

Bug #18202

closed

Candlepin tables are missing primary key

Added by Karlis Melderis about 8 years ago. Updated over 6 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I found that set of candlepin tables don't have primary key thus I cannot move DB to Postgress BDR (updates and deletes are denied)

Here are keys I added

\d+ cp_consumer_content_tags
ALTER TABLE cp_consumer_content_tags ADD PRIMARY KEY (consumer_id, content_tag);
\d+ cp_content_modified_products;
ALTER TABLE cp_content_modified_products ADD PRIMARY KEY (cp_content_id, element);
\d+ cp_pool_branding
ALTER TABLE cp_pool_branding ADD PRIMARY KEY (pool_id, branding_id);
\d+ cp_product_dependent_products
ALTER TABLE cp_product_dependent_products ADD PRIMARY KEY (cp_product_id, element);
\d+ cp_sub_branding
ALTER TABLE cp_sub_branding ADD PRIMARY KEY (subscription_id, branding_id);
\d+ cp_sub_derivedprods
ALTER TABLE cp_sub_derivedprods ADD PRIMARY KEY (subscription_id, product_id);
\d+ databasechangelog
ALTER TABLE databasechangelog ADD PRIMARY KEY (id);

Actions

Also available in: Atom PDF