You are here

function swftools_update_6009 in SWF Tools 6.3

Creates the SWF Tools cache table {cache_swftools}.

File

./swftools.install, line 451
Install, update and uninstall functions for the SWF Tools module.

Code

function swftools_update_6009() {

  // Initialise a results array
  $ret = array();

  // Define the cache schema
  $schema['cache_swftools'] = array(
    'description' => 'Cache table for SWF Tools to keep its markup, playlists and settings.',
    '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,
      ),
      'headers' => array(
        'description' => 'Any custom HTTP headers to be added to cached data.',
        'type' => 'text',
        'not null' => FALSE,
      ),
      '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',
    ),
  );

  // Create the cache table
  db_create_table($ret, 'cache_swftools', $schema['cache_swftools']);

  // Return results
  return $ret;
}