由于我更新了 Magento(从 1.4.2.0 到 1.7.0.2),在我清理缓存之后和重新索引所有之前,我总是收到以下错误:
a:5:{i:0;s:233:"Error in file: "/html/magento_update/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'report_viewed_product_aggregated_daily' already exists";i:1;s:942:"#0 /html/magento_update/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /html/magento_update/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.0.0', '1.6.0.0.1')
#2 /html/magento_update/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.0.0', '1.6.0.0.1')
#3 /html/magento_update/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /html/magento_update/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /html/magento_update/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 /html/magento_update/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /html/magento_update/index.php(87): Mage::run('', 'store')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
我使用此代码来清理缓存:
Mage::app()->cleanCache();
$enable = array();
foreach ( Mage::helper( 'core' )->getCacheTypes() as $type => $label ) {
$enable[$type] = 1;
}
Mage::app()->saveUseCache( $enable );
因为它在文件“upgrade-1.6.0.0-1.6.0.0.1.php”中......也许更新出了问题?我是通过 SSH 完成的,遵循不同的操作方法......以解决发生的错误。