我尝试升级我的自定义 Magento 模块,但由于某种原因它无法正常工作。
我的模块配置:
<?xml version="1.0"?>
<config>
<modules>
<MVE_CategoryAttribute>
<version>0.1.1</version>
</MVE_CategoryAttribute>
</modules>
<global>
<resources>
<categoryattribute_setup>
<setup>
<module>MVE_CategoryAttribute</module>
<class>Mage_Eav_Model_Entity_Setup</class>
</setup>
<connection>
<use>default_setup</use>
</connection>
</categoryattribute_setup>
</resources>
</global>
</config>
安装脚本(mysql4-install-0.1.0.php):
<?php
$this->startSetup();
$this->addAttribute('catalog_category', 'imagetext', array(
'group' => 'General Information',
'input' => 'textarea',
'type' => 'varchar',
'label' => 'Tekst op afbeelding',
'backend' => '',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
$this->endSetup();
?>
升级脚本(mysql4-upgrade-0.1.0-0.1.1.php):
<?php
$this->startSetup();
$this->updateAttribute('catalog_category', 'imagetext', 'global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE);
$this->endSetup();
?>