Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento custom model won't allow DB table changes

I've run into an issue with a custom Magento module I've created.

In short, I created a simple module for customer uploads on the front-end. I created a new table with some generic fields like 'project_id', 'title', etc. This is all fine...I can set model variables and save them to my table using model->save();.

Just now I have the need to add a new field or change an old field's name around. For a reason that I can't understand new fields and changed fields will not get stored to via model->save(); even though I can see from my debugger that new and changed variables in my model are being set correctly. I'm hoping someone has run into this already and can shed some light on this extremely frustrating issue. My project is at a stand-still until help arrives!

like image 875
Jared Eitnier Avatar asked Jan 05 '12 23:01

Jared Eitnier


Video Answer


1 Answers

Clear you cache. The Zend classes Magento uses to read database columns will cache that information (such that it's not necessary to do a DESCRIBE for each model load/save). Clear out your cache and Magento should see the new columns, and values will start persisting to the database.

like image 160
Alan Storm Avatar answered Sep 28 '22 08:09

Alan Storm