function statistics_schema
Same name in other branches
- 7.x modules/statistics/statistics.install \statistics_schema()
- 8.9.x core/modules/statistics/statistics.install \statistics_schema()
- 10 core/modules/statistics/statistics.install \statistics_schema()
- 11.x core/modules/statistics/statistics.install \statistics_schema()
Implements hook_schema().
File
-
core/
modules/ statistics/ statistics.install, line 20
Code
function statistics_schema() {
$schema['node_counter'] = [
'description' => 'Access statistics for {node}s.',
'fields' => [
'nid' => [
'description' => 'The {node}.nid for these statistics.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
'totalcount' => [
'description' => 'The total number of times the {node} has been viewed.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'big',
],
'daycount' => [
'description' => 'The total number of times the {node} has been viewed today.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'medium',
],
'timestamp' => [
'description' => 'The most recent time the {node} has been viewed.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
],
'primary key' => [
'nid',
],
];
return $schema;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.