Issue
$users = TableRegistry::getTableLocator()->get('users');
$user = $users->find()->where(['mail' => 'XXX@XXX.COM'])->first();
debug($user);
This code returns all the fields of user XXX in DEV environment. However, on PROD, it returns only a few fields (the first ones I created).
I wonder if there is a cache on the queries? If so, how can I reset it ?
Solution
If I clear /www/tmp/cache/*, it works well but I don't know if it's the best way to solve this issue
Specifically the database schema is cached in tmp/cache/models
, that is when you're using the default file cache engine.
It's perfectly fine to delete the files, that is what needs to be done in your case, but even better would be to use the schema cache CLI tool, as it will ensure that clearing the cache works for different cache engines too:
bin/cake schema_cache clear
See also
Answered By - ndm
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.