2
mysql> select * from core_resource;
+-------------------------+------------+--------------+
| code                    | version    | data_version |
+-------------------------+------------+--------------+
| adminnotification_setup | 1.0.0      | 1.0.0        |

我从来没有看到这两列之间的值有差异,而且我不确定 data_version 的确切用途。

这是有用的东西吗?我可以从中受益吗?

4

1 回答 1

4

data_version而相应的所谓“数据升级脚本”出现在CE1.4中。

数据安装/升级脚本在形式和功能上与“常规”安装和升级脚本相同。它们只是在初始化期间稍后执行,主要的环境差异是有一个存储对象和一个初始化的请求对象,尽管我无法想象后者在升级工作流程中的适当使用。

来自Mage_Core_Model_App

public function run($params)
{
    //snip...
    if ($this->_cache->processRequest()) { //cache hook
        $this->getResponse()->sendResponse();
    } else {
        $this->_initModules(); //triggers "normal" install & upgrade workflow
        //snip...
        if ($this->_config->isLocalConfigLoaded()) {
            //snip...
            $this->_initCurrentStore($scopeCode, $scopeType);
            $this->_initRequest();
            Mage_Core_Model_Resource_Setup::applyAllDataUpdates(); //data upgrade scripts
        }

        $this->getFrontController()->dispatch();
    }
    return $this;
}
于 2012-06-20T16:58:43.120 回答