You are here

function field_collection_update_7005 in Field collection 7

Force the creation of the table cache_entity_field_collection_item.

Update entity_update_7003() will attempt to install entitycache tables for existing modules, but it uses module_list() to get the list of available modules, which, when called from a database update, may not return field_collection since drupal is bootstrapped at a lower level.

File

./field_collection.install, line 301
Install, update and uninstall functions for the field_collection module.

Code

function field_collection_update_7005() {
  if (module_exists('entitycache')) {
    $entity_type = 'field_collection_item';
    $table = 'cache_entity_' . $entity_type;
    if (!db_table_exists($table)) {
      $schema = drupal_get_schema_unprocessed('system', 'cache');
      $schema['description'] = 'Cache table used to store' . $entity_type . ' entity records.';
      db_create_table($table, $schema);
    }
  }
}