I have an old module and I need to update it so it will work with a newer Magento version. Basically the module adds some customer fields.
So there a config.xml
like this:
<config>
<modules>
<DWI_Customer>
<version>1.0.1</version>
</DWI_Customer>
</modules>
<global>
<fieldsets>
<customer_account>
<membernumber><create>1</create><update>1</update></membernumber>
...
</customer_account>
</fieldsets>
</global>
</config>
Notice there is no resources setup config defined but stilll there is a Entity/Setup.php
class DWI_Customer_Model_Entity_Setup extends Mage_Eav_Model_Entity_Setup
{
public function getDefaultEntities()
{
return array(
'customer' => array(
'entity_model' =>'customer/customer',
'table' => 'customer/entity',
'increment_model' => 'eav/entity_increment_numeric',
'increment_per_store' => false,
'additional_attribute_table' => 'customer/eav_attribute',
'entity_attribute_collection' => 'customer/eav_attribute',
'attributes' => array(
'membernumber' => array(
'label' => 'Member No',
'visible' => true,
'sort_order' => 65,
),
....
);
}
}
With newer version those fields are not visible (but added to eav_attribute
) and I need to add an upgrade script like this:
$config->getAttribute('customer', 'membernumber' )
->setData( 'used_in_forms', array( 'adminhtml_customer' ) )
->save();
I did the with other modules and it worked fine. Problem here is I don't have sql/customer_setup/mysql4....
here. Also it looks like the module does not show up in core_resource
or I am not sure how it would be named. customer_setup
feels right but that is already been used by Mage/Customer.
Question is: How do I add an upgrade script for this module?
dwi_customer_setup
. and put the upgrade scripts insql/dwi_customer_setup
.resources
tag inside thefieldsets
. Move it one level higher