You are here

function file_download_counter_schema in File Download 8

Implements hook_schema().

File

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

Code

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