Posted on Leave a comment

New table column not updating in Magento

Magento Logo

So you’ve added a custom column for a table, e.g. admin_user or through your custom extension’s model table. The only problem is your values are not being stored by your underlying model classes, i.e. abstractions of Mage_Core_Model_Abstract. But why you ask since Magento is supposed to automatically infer database table to model relations through Zend_Db and magic getters and setters (simply put).

Clear that cache

Well, in fact the solution is pretty simple:

Zend_Db caches the structure of the database tables.

Thus, if you add new columns make sure to refresh the cache. Zend will then update the cache accordingly.

Also note that even if you all your caches are disabled the database structure and other info may still be cached in var/cache, so:

Clear /var/cache.

to make sure that your table adaptions reflect properly.