diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install index 4abb2a7..e2540c0 100644 --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -678,63 +678,10 @@ function locale_update_8010() { * Add a cache table and locale_project table for the locale module. */ function locale_update_8011() { - // @todo http://drupal.org/node/1627006#comment-6396658 - // Use a similar method to http://api.drupal.org/api/drupal/modules%21update%21update.install/function/update_update_7001/7 - // instead of re-defining the schema again. // Add a 'locale' cache table. - db_create_table('cache_locale', array( - 'description' => 'Cache table for the locale module to store various data.', - 'fields' => array( - 'cid' => array( - 'description' => 'Primary Key: Unique cache ID.', - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '', - ), - 'data' => array( - 'description' => 'A collection of data to cache.', - 'type' => 'blob', - 'not null' => FALSE, - 'size' => 'big', - ), - 'expire' => array( - 'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - 'created' => array( - 'description' => 'A Unix timestamp indicating when the cache entry was created.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - 'serialized' => array( - 'description' => 'A flag to indicate whether content is serialized (1) or not (0).', - 'type' => 'int', - 'size' => 'small', - 'not null' => TRUE, - 'default' => 0, - ), - 'tags' => array( - 'description' => 'Space-separated list of cache tags for this entry.', - 'type' => 'text', - 'size' => 'big', - 'not null' => FALSE, - ), - 'checksum' => array( - 'description' => 'The tag invalidation sum when this entry was saved.', - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), - ), - 'indexes' => array( - 'expire' => array('expire'), - ), - 'primary key' => array('cid'), - )); + $locale_cache_schema = system_schema_cache_8001(); + $locale_cache_schema['description'] = 'Cache table for the locale module to store various data.'; + db_create_table('cache_locale', $locale_cache_schema); // Add locale_project table. db_create_table('locale_project', array( diff --git a/core/modules/system/system.install b/core/modules/system/system.install index ac983aa..adb7ced 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1472,6 +1472,68 @@ function system_schema() { return $schema; } +/** + * The cache schema corresponding to Drupal 8.0. + * + * Helper function to add cache tables in the Drupal 7 to 8 upgrade path + * without relying on system_schema(), which may change with future updates. + */ +function system_schema_cache_8001() { + return array( + 'description' => 'Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.', + 'fields' => array( + 'cid' => array( + 'description' => 'Primary Key: Unique cache ID.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'data' => array( + 'description' => 'A collection of data to cache.', + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + ), + 'expire' => array( + 'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'created' => array( + 'description' => 'A Unix timestamp indicating when the cache entry was created.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'serialized' => array( + 'description' => 'A flag to indicate whether content is serialized (1) or not (0).', + 'type' => 'int', + 'size' => 'small', + 'not null' => TRUE, + 'default' => 0, + ), + 'tags' => array( + 'description' => 'Space-separated list of cache tags for this entry.', + 'type' => 'text', + 'size' => 'big', + 'not null' => FALSE, + ), + 'checksum' => array( + 'description' => 'The tag invalidation sum when this entry was saved.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'expire' => array('expire'), + ), + 'primary key' => array('cid'), + ); +} + // Updates for core. function system_update_last_removed() {