diff --git a/entity.module b/entity.module
index 81ad379..3e0f3bb 100644
--- a/entity.module
+++ b/entity.module
@@ -843,6 +843,48 @@ function _entity_defaults_rebuild($entity_type) {
 }
 
 /**
+ * Implements hook_modules_installed().
+ */
+function entity_modules_installed($modules) {
+  // entitycache.module does not create cache tables for supporting entities
+  // automatically, so we need to.
+  foreach(_entity_crud_cache_get_info($modules) as $entity_type => $entity_info) {
+    $schema = drupal_get_schema_unprocessed('system', 'cache');
+    $schema['description'] = 'Cache table used to store' . $entity_type . ' entity records.';
+    db_create_table('cache_entity_' . $entity_type, $schema);
+  }
+}
+
+/**
+ * Implements hook_modules_uninstalled().
+ */
+function entity_modules_uninstalled($modules) {
+  foreach(_entity_crud_cache_get_info($modules) as $entity_type => $entity_info) {
+    db_drop_table('cache_entity_' . $entity_type);
+  }
+}
+
+/**
+ * Fetches entity info about entities that support caching from specific modules.
+ */
+function _entity_crud_cache_get_info($modules) {
+  $info = array();
+  $entity_api_types = array_keys(entity_crud_get_info());
+  foreach($modules as $module) {
+    if ($module_entity_info = module_invoke($module, 'entity_info')) {
+      if ($module_entity_api_types = array_intersect_key($module_entity_info, array_reverse($entity_api_types))) {
+        foreach ($module_entity_api_types as $entity_type => $entity_info) {
+          if (!empty($entity_info['entity cache'])) {
+            $info[$entity_type] = $entity_info;
+          }
+        }
+      }
+    }
+  }
+  return $info;
+}
+
+/**
  * Implements hook_modules_enabled().
  */
 function entity_modules_enabled($modules) {
