cancel
Showing results for 
Search instead for 
Did you mean: 

Possible data inconsistency in "cataloginventory_stock_item"

0 Kudos

Possible data inconsistency in "cataloginventory_stock_item"

Feature request from flancer64, posted on GitHub Jun 07, 2016

Hello,

I discovered DB structure and found that there is extra field named "website_id" in "cataloginventory_stock_item".

Each stock item is related to "cataloginventory_stock" (foreign key: stock_id). Stock record in "cataloginventory_stock" has field "website_id" is related to "store_website". So, each record in "cataloginventory_stock_item" is related to record in "cataloginventory_stock" and is related to record in "store_website".

Field "website_id" in "cataloginventory_stock_item" (without references/foreign key to "store_website") can contain any value - not only different from the "website_id" in related "cataloginventory_stock" record, but really any smallint(5) UNSIGNED value. mage2_stock_item_website_id

I suppose, field "cataloginventory_stock_item.website_id" is extra field and should be removed.

Thanks.