Saya menulis pembaruan ini hanya berbagi penelitian saya dan berharap dapat membantu seseorang di luar sana.
config.xml
<config>
<modules>
<Package_Module>
<version>0.0.2</version>
</Package_Module>
</modules>
<global>
<resources>
<module_setup>
<setup>
<module>Package_Module</module>
<!--
Create a Switchable Installer Script
This class is incredibly handy in case you need different setup classes
-->
<class>Package_Module_Model_Resource_Setup</class>
</setup>
</module_setup>
</resources>
</global>
<config>
Kelas Penyetelan Kustom: Package_Module_Model_Resource_Setup
class Package_Module_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
{
public function getCatalogResourceSetup()
{
return new Mage_Catalog_Model_Resource_Setup('module_setup');
}
public function getCustomerResourceSetup()
{
return new Mage_Customer_Model_Resource_Setup('module_setup');
}
public function getCustomerEntitySetup()
{
return new Mage_Customer_Model_Entity_Setup('module_setup');
}
}
Skrip Upgrade: mysql4-upgrade-0.0.1-0.0.2.php
<?php
/* @var $installer Package_Module_Model_Resource_Setup */
$installer = $this->getCustomerEntitySetup();
$installer->startSetup();
/*** Update customer address attributes*/
$installer->updateAttribute('customer_address', 'region', 'is_required', 1);
$installer->endSetup();
Dengan ini sebuah artikel bagus yang membagikan tentang 'Switchable Installer Script'. Tautan sumber: inchoo.net