Before a few days, I was working on a project in CakePHP. I made some model related changes, like changed the relationship of models and added new fields to table in database.
After uploading the code to live server, when I checked the site, no difference was seen as compared to earlier version of site. I wondered what had happened. Where have all the changes gone or why no change has been applied even though I changed the code in models?
Everything was working fine, except that the changes in model and database were not reflected.
I contemplated a lot, then I realized that I should have cleared the cache of models.
So for that I deleted cache folder in /app/tmp/ and voila, everything worked fine. I had found the solution.
There is another trick [which actually does the same thing as above] for solving this problem :
> First change the debug level to 3 in your core.php file.
> Reload your application in browser.
> Change the debug level back to 0.
That’s it.
So remember, any time you add a new model or adjust your associations or make changes in structure of your database table, be sure to delete the cache folder from the /app/tmp/ folder.
Thanks a ton. Very helpful tips.
Hi,
Very good article. Thanks for sharing.
Wahh bhai wahh
Su vat 6