You are here

function yandex_metrics_reports_schema in Yandex.Metrics 8.3

Same name and namespace in other branches
  1. 8.2 yandex_metrics_reports/yandex_metrics_reports.install \yandex_metrics_reports_schema()
  2. 6.2 yandex_metrics_reports/yandex_metrics_reports.install \yandex_metrics_reports_schema()
  3. 7.3 yandex_metrics_reports/yandex_metrics_reports.install \yandex_metrics_reports_schema()
  4. 7.2 yandex_metrics_reports/yandex_metrics_reports.install \yandex_metrics_reports_schema()

Implements hook_schema().

File

yandex_metrics_reports/yandex_metrics_reports.install, line 21
Install, uninstall and update the module.

Code

function yandex_metrics_reports_schema() {
  $schema['yandex_metrics_reports_popular_content'] = array(
    'description' => 'Stores the popular content.',
    'fields' => array(
      'yid' => array(
        'description' => 'The id for url.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'url' => array(
        'description' => 'The url obtained from Yandex.metrika.',
        'type' => 'varchar',
        'length' => 2048,
        'not null' => TRUE,
        'default' => '',
      ),
      'language' => array(
        'description' => 'Language of the page.',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_title' => array(
        'description' => 'The page title of the url.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_views' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Page views of this url.',
      ),
    ),
    'primary key' => array(
      'yid',
    ),
    'indexes' => array(
      'language' => array(
        'language',
      ),
      'url' => array(
        array(
          'url',
          255,
        ),
      ),
    ),
  );
  return $schema;
}