You are here

function history_schema in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/history/history.install \history_schema()

Implements hook_schema().

File

core/modules/history/history.install, line 11
Installation functions for History module.

Code

function history_schema() {
  $schema['history'] = array(
    'description' => 'A record of which {users} have read which {node}s.',
    'fields' => array(
      'uid' => array(
        'description' => 'The {users}.uid that read the {node} nid.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => 'The {node}.nid that was read.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'timestamp' => array(
        'description' => 'The Unix timestamp at which the read occurred.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'uid',
      'nid',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
    ),
  );
  return $schema;
}