0
votes

Today I found that some database tables in my Magento 1.9.0.1 installation don't have primary keys. I found out during a search and replace in the database.

Are the primary keys important to run Magento properly? If so, how do I add them to the tables? I've checked out the Magento Database Repair Tool, however that only fixed foreign keys, not primary keys.

Any thoughts?

Thanks.

Missing primary keys:

The table "api_session" has no primary key. Changes will have to be made manually.

The table "catalog_category_anc_categs_index_idx" has no primary key. Changes will have to be made manually.

The table "catalog_category_anc_categs_index_tmp" has no primary key. Changes will have to be made manually.

The table "catalog_category_anc_products_index_idx" has no primary key. Changes will have to be made manually.

The table "catalog_category_anc_products_index_tmp" has no primary key. Changes will have to be made manually.

The table "catalog_category_product_index_enbl_idx" has no primary key. Changes will have to be made manually.

The table "catalog_category_product_index_enbl_tmp" has no primary key. Changes will have to be made manually.

The table "catalog_category_product_index_idx" has no primary key. Changes will have to be made manually.

The table "catalog_category_product_index_tmp" has no primary key. Changes will have to be made manually.

The table "log_url" has no primary key. Changes will have to be made manually. The table "shipment_carriers" has no primary key. Changes will have to be made manually.

The table "shipment_export" has no primary key. Changes will have to be made manually.

The table "weee_discount" has no primary key. Changes will have to be made manually.

1

1 Answers

0
votes

The following table in your list should have a primary key:

log_url

The following tables are not in out of the box Magento:

shipment_carriers
shipment_export

The rest of the tables do not have primary keys. This is okay, not all tables need to have primary keys, for example tables that join two tables or temporary tables. All the index tables are temporary and get cleared out pretty frequently, therefore no primary key needed.