Magento:core_directory_storage doesn’t exist

1,993 人次阅读
没有评论

共计 1648 个字符,预计需要花费 5 分钟才能阅读完成。

You should just create this missed table.

I’ve found the SQL code of this table in /app/code/core/Mage/Core/Model/Mysql4/File/Storage/Directory/Database.php

/**
* Create database scheme for storing files
*
* @return Mage_Core_Model_Mysql4_File_Storage_Database
*/
public function createDatabaseScheme()
{
$this->_getWriteAdapter()->multi_query("CREATE TABLE IF NOT EXISTS {$this->getMainTable()} (
`directory_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`path` varchar(255) NOT NULL DEFAULT '',
`upload_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`parent_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`directory_id`),
UNIQUE KEY `IDX_DIRECTORY_PATH` (`name`, `path`),
KEY `parent_id` (`parent_id`),
CONSTRAINT `FK_DIRECTORY_PARENT_ID` FOREIGN KEY (`parent_id`)
REFERENCES {$this->getMainTable()} (`directory_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Directory storage'");

return $this;
}

After cleaning

CREATE TABLE IF NOT EXISTS `PREFIX_core_directory_storage` (
`directory_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`path` varchar(255) NOT NULL DEFAULT '',
`upload_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`parent_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`directory_id`),
UNIQUE KEY `IDX_DIRECTORY_PATH` (`name`, `path`),
KEY `parent_id` (`parent_id`),
CONSTRAINT `FK_DIRECTORY_PARENT_ID` FOREIGN KEY (`parent_id`)
REFERENCES `PREFIX_core_directory_storage` (`directory_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Directory storage';

Don’t forget to write name of the table with your prefix. (’PREFIX_core_directory_storage’)

正文完
 0