You are here

analytics.install in Analytics 7

Same filename and directory in other branches
  1. 6 analytics.install

File

analytics.install
View source
<?php

/**
 * Implements hook_schema().
 */
function analytics_schema() {
  $schema['analytics_service'] = array(
    'description' => '',
    'fields' => array(
      'sid' => array(
        'description' => 'Primary ID field for the table. Not used for anything except internal lookups.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'machine_name' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'description' => array(
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
      'service' => array(
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'locked' => array(
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'options' => array(
        'type' => 'blob',
        'size' => 'big',
        'not null' => FALSE,
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'sid',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
    'export' => array(
      'key' => 'machine_name',
      'key name' => 'Machine name',
      'primary key' => 'sid',
      'identifier' => 'service',
      'default hook' => 'analytics_default_service',
      'cache defaults' => TRUE,
      'api' => array(
        'owner' => 'analytics',
        'api' => 'analytics_default_service',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function analytics_uninstall() {
  variable_del('analytics_privacy_dnt');
  variable_del('analytics_privacy_anonymize_ip');
}

Functions

Namesort descending Description
analytics_schema Implements hook_schema().
analytics_uninstall Implements hook_uninstall().