You are here

views_data_export.install in Views data export 6

File

views_data_export.install
View source
<?php

/**
 * Implementation of hook_schema()
 */
function views_data_export_schema() {
  $schema = array();
  $schema['views_data_export'] = array(
    'description' => t('Keep track of currently executing exports.'),
    'fields' => array(
      'eid' => array(
        'description' => 'Unique id for each on-going export.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'view_name' => array(
        'type' => 'varchar',
        'length' => '32',
        'default' => '',
        'not null' => TRUE,
        'description' => 'The unique name of the view. This is the primary field views are loaded from, and is used so that views may be internal and not necessarily in the database. May only be alphanumeric characters plus underscores.',
      ),
      'view_display_id' => array(
        'type' => 'varchar',
        'length' => '32',
        'default' => '',
        'not null' => TRUE,
        'description' => 'The unique name of the view. This is the primary field views are loaded from, and is used so that views may be internal and not necessarily in the database. May only be alphanumeric characters plus underscores.',
      ),
      'time_stamp' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The time this export started',
      ),
      'fid' => array(
        'description' => 'Files ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'batch_state' => array(
        'type' => 'varchar',
        'length' => '32',
        'default' => 'init',
        'not null' => TRUE,
        'description' => 'The current state of the batch.',
      ),
      'sandbox' => array(
        'type' => 'text',
        'default' => '',
        'not null' => TRUE,
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'eid',
    ),
  );
  $schema['views_data_export_object_cache'] = array(
    'description' => 'A modified version of the views_object_cache that ignores session id.',
    'fields' => array(
      'eid' => array(
        'type' => 'varchar',
        'length' => '64',
        'description' => 'The export ID this view equates too.',
      ),
      'updated' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The time this cache was created or updated.',
      ),
      'data' => array(
        'type' => 'blob',
        // Updated to 'text' (with size => 'big') in views_schema_6004()
        'description' => 'Serialized data being stored.',
        'serialize' => TRUE,
      ),
    ),
    'indexes' => array(
      'eid' => array(
        'eid',
      ),
      'updated' => array(
        'updated',
      ),
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_install()
 */
function views_data_export_install() {
  drupal_install_schema('views_data_export');
}

/**
 * Implementation of hook_uninstall()
 */
function views_data_export_uninstall() {

  //Clean up any tables we may have left around
  views_data_export_garbage_collect(0, -1);

  //Remove our base table
  drupal_uninstall_schema('views_data_export');
}

Functions

Namesort descending Description
views_data_export_install Implementation of hook_install()
views_data_export_schema Implementation of hook_schema()
views_data_export_uninstall Implementation of hook_uninstall()