You are here

function closeblock_schema in Close Block 6

Same name and namespace in other branches
  1. 7 closeblock.install \closeblock_schema()

Implements hook_schema().

File

./closeblock.install, line 18
Install hooks for Closeblock.

Code

function closeblock_schema() {
  $schema['closeblock'] = array(
    'description' => 'Stores block closing information',
    'fields' => array(
      'module' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
        'description' => "The module from which the block originates; for example, 'user' for the Who's Online block, and 'block' for any custom blocks.",
      ),
      'delta' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '0',
        'description' => 'Unique ID for block within a module.',
      ),
      'theme' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The theme under which the block settings apply.',
      ),
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => "User's {users}.uid.",
      ),
      'count' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Count of closing',
      ),
      'timestamp' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Timestamp for when user has closed block.',
      ),
    ),
    'unique keys' => array(
      'tmdu' => array(
        'theme',
        'module',
        'delta',
        'uid',
      ),
    ),
    'indexes' => array(
      'list' => array(
        'theme',
        'module',
        'uid',
      ),
    ),
  );
  return $schema;
}