<resources>
<{{MODEL_ALIAS}}_setup>
<setup>
<module>{{Vendor_Extension}}</module>
<class>Mage_Customer_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</{{MODEL_ALIAS}}_setup>
<{{MODEL_ALIAS}}_write>
<connection>
<use>core_write</use>
</connection>
</{{MODEL_ALIAS}}_write>
<{{MODEL_ALIAS}}_read>
<connection>
<use>core_read</use>
</connection>
</{{MODEL_ALIAS}}_read>
</resources>
Variable $installer must be instance of Mage_Customer_Model_Entity_Setup
<?php
$installer = $this; // or new Mage_Customer_Model_Entity_Setup('core_setup'); if you dosen't set this class in resources
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup("core_setup");
$entityTypeId = $setup->getEntityTypeId("customer");
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
$attributeCode = "telephone"; // attribute code what will be created
$installer->removeAttribute('customer', $attributeCode); // remove attribute if exist
$installer->addAttribute(
"customer",
$attributeCode,
array(
"type" => "varchar",
"backend" => "",
"label" => "Telephone",
"input" => "text",
"source" => "",
"visible" => true,
"required" => false,
"default" => "",
"frontend" => "",
"unique" => false,
"note" => "Customer telephone"
)
);
$attribute = Mage::getSingleton("eav/config")->getAttribute("customer", $attributeCode);
$setup->addAttributeToGroup(
$entityTypeId,
$attributeSetId,
$attributeGroupId,
$attributeCode,
"100" // sort_order
);
$usedInForms = array(
"adminhtml_customer",
// "checkout_register",
// "customer_account_create",
"customer_account_edit",
// "adminhtml_checkout"
);
$attribute->setData("used_in_forms", $usedInForms)
->setData("is_used_for_customer_segment", true)
->setData("is_system", 0)
->setData("is_user_defined", 1)
->setData("is_visible", 1)
->setData("sort_order", 100)
;
$attribute->save();
$installer->endSetup();