1
votes

currently i am developing a Magento extension, that needs to add several custom attributes to customer address. I've found several tutorials on the topic that describe precisely what i need to build http://www.unexpectedit.com/magento/add-new-customer-attribute-onepage-magento-checkout http://www.excellencemagentoblog.com/magento-adding-custom-field-to-customer-address

They all use ALTER TABLE to add columns to several db tables.My question is :

Is it upgrade safe to do this?

Thanks in advance

1

1 Answers

1
votes

They're using the magento framework method addAttribute() not pure SQL queries. They're using it in an upgrade script and it's its purpose : to upgrade safely a database..

Note that the EAV mechanims of the customer entity is built in order to not alter the table definition but add data in it. So in the background customer::addAttribute doesn't do a single ALTER TABLE. On the contrary, the now flated-tables sales_flat_order/quote addAttribute method does alter the tables cause it's no more an EAV entity.

They're doing it right.

I don't really understand your question.