You are here

cache_actions_test.install in Cache Actions 7

Same filename and directory in other branches
  1. 6.2 cache_actions_test/cache_actions_test.install

This is the install file for the test module. It adds a cache table that it uses for testing.

File

cache_actions_test/cache_actions_test.install
View source
<?php

/**
 * @file
 * This is the install file for the test module. It adds a cache table
 * that it uses for testing.
 */
function cache_actions_test_install() {
  drupal_install_schema('cache_actions_test');
}
function cache_actions_test_schema() {
  $schema['cache_cache_actions_test'] = array(
    'description' => 'Cache table for cache actions test.',
    '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',
    ),
  );
  return $schema;
}
function cache_actions_test_uninstall() {
  if (db_table_exists('cache_cache_actions_test')) {
    drupal_uninstall_schema('cache_actions_test');
  }
}

Functions

Namesort descending Description
cache_actions_test_install @file This is the install file for the test module. It adds a cache table that it uses for testing.
cache_actions_test_schema
cache_actions_test_uninstall