You are here

function google_analytics_reports_update_7304 in Google Analytics Reports 7.3

Import Google Analytics fields.

File

./google_analytics_reports.install, line 343
Contains install and update functions for Google Analytics Reports module.

Code

function google_analytics_reports_update_7304(&$sandbox) {

  // A copy of the current schema. It may be changed in the future.
  // @see https://www.drupal.org/node/150220.
  $schema['google_analytics_reports_fields'] = array(
    'description' => 'Dimensions and metrics from Google Analytics.',
    'fields' => array(
      'gaid' => array(
        'description' => 'The primary identifier for a column.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'type' => array(
        'description' => 'The type of column.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'data_type' => array(
        'description' => 'The type of data this column represents.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'column_group' => array(
        'description' => 'The dimensions/metrics group the column belongs to.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'ui_name' => array(
        'description' => 'The name/label of the column used in user interfaces (UI).',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'description' => array(
        'description' => 'The full description of the column.',
        'type' => 'text',
        'size' => 'medium',
      ),
      'calculation' => array(
        'description' => 'This shows how the metric is calculated. Only available for calculated metrics.',
        'type' => 'varchar',
        'length' => 255,
      ),
    ),
    'indexes' => array(
      'type' => array(
        'type',
      ),
    ),
    'unique keys' => array(
      'gaid' => array(
        'gaid',
      ),
    ),
    'primary key' => array(
      'gaid',
    ),
  );
  db_create_table('google_analytics_reports_fields', $schema['google_analytics_reports_fields']);
  module_load_include('module', 'google_analytics_reports');
  google_analytics_reports_fields_import();
}