Background: I have inherited a rather large import routine running as a custom Magento module. It deals with importing products, categories, images, accessories, associations, etc....pretty much everything. Most of it is now working. However when it comes to importing Accessories I run into all sorts of Integrity constraint violations (duplicate entries) or foreign key restriction issues with tables like cataloginventory_stock_item.
Actual question: When running the catalog/product delete commands early on in the process, e.g.
$collection = Mage::getModel('catalog/product')->getCollection();
foreach($collection as $key=>$value)
{
Mage::getModel('catalog/product')->load($value->entity_id)->delete();
}
what tables get affected by this, is it just the product_entity table or are various other product related tables in background also modified?
I am trying to work out what tables I may manually need to truncate (can this be done via a Magento model/method ?) or what ones will be affected properly along the way by the magento core.
Many thanks