function system_schema_cache_7054

The cache schema corresponding to system_update_7054.

Drupal 7 adds several new cache tables. Since they all have identical schema this helper function allows them to re-use the same definition, without relying on system_schema(), which may change with future updates.

6 calls to system_schema_cache_7054()
block_update_7006 in modules/block/block.install
Recreates cache_block table.
filter_update_7009 in modules/filter/filter.install
Converts fields that store serialized variables from text to blob.
image_update_7000 in modules/image/image.install
Install the schema for users upgrading from the contributed module.
system_update_7054 in modules/system/system.install
Remove {cache_*}.headers columns.
update_fix_d7_requirements in includes/update.inc
Perform Drupal 6.x to 7.x updates that are required for update.php to function properly.

... See full list

File

modules/system/system.install, line 1789

Code

function system_schema_cache_7054() {
    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,
            ),
        ),
        'indexes' => array(
            'expire' => array(
                'expire',
            ),
        ),
        'primary key' => array(
            'cid',
        ),
    );
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.