You are here

function statistics_schema in Zircon Profile 8

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

Implements hook_schema().

File

core/modules/statistics/statistics.install, line 20
Install and update functions for the Statistics module.

Code

function statistics_schema() {
  $schema['node_counter'] = array(
    'description' => 'Access statistics for {node}s.',
    'fields' => array(
      'nid' => array(
        'description' => 'The {node}.nid for these statistics.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'totalcount' => array(
        'description' => 'The total number of times the {node} has been viewed.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'size' => 'big',
      ),
      'daycount' => array(
        'description' => 'The total number of times the {node} has been viewed today.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'size' => 'medium',
      ),
      'timestamp' => array(
        'description' => 'The most recent time the {node} has been viewed.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}