Change custom entity fields I'm facing very strange problem with changing my custom entity's fields. I've a custom entity with id, type, .. , premium, premium_expires_at, .. fields. It was  working without any problems with its own fields (those declared in hook_schema()) till today, but suddenly I changed its fields, dropped premium, and premium_expires_at fields, added new fields with HOOK _update_n function. I see database schema changed, but those deleted fields are still being shown in base table key under field_sql_storage key.. I've already ran update.php (many times), but no luck.. I thought it's a caching problem, so I've cleared all caches manually, and with drush, no luck, cleared memcached data (with telnet), any changes.Every time I'm getting the same error, like this:


  PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.premium' in 'field list': SELECT ... base.premium AS premium... в функции EntityCacheControllerHelper::entityCacheLoad() (строка 101 в файле /PATH_TO_MY_PROJECT/sites/all/modules/entitycache/entitycache.module)


I don't have any premium field in my db schema, but still getting this error, is there any way to solve it?

(I am using EntityAPI with Entitycache and Memcache Storage modules).
I finally solved this problem somehow.. I think this is an EntityAPI's issue. So, here is my (temporary) solution:


removed those changed fields directly from hook_schema, added new fields directly to it.
removed those fields with db_drop_field function and added new fields with db_add_field function with hook_update_n function. By this way I managed to have the same structure in my (changed) entity and db table schema.
flushed the caches


Error has gone, so far everything is working fine. But I'm not sure this solution will not cause any problems in future... I still can't understand why entity api doesn't see changed fields in hook_update_n function...