You are here

disqus.install in Disqus 7

Same filename and directory in other branches
  1. 8 disqus.install
  2. 6 disqus.install

Provides any required installation or upgrade path requirements.

File

disqus.install
View source
<?php

/**
 * @file
 * Provides any required installation or upgrade path requirements.
 */

/**
 * Implementation of hook_schema().
 */
function disqus_schema() {
  $schema = array();
  $schema['disqus'] = array(
    'fields' => array(
      'did' => array(
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'did',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
      'status' => array(
        'status',
      ),
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function disqus_uninstall() {
  $variables = array(
    'disqus_combination_widget_colortheme',
    'disqus_combination_widget_defaulttabview',
    'disqus_combination_widget_excerpt_length',
    'disqus_combination_widget_hide_mods',
    'disqus_combination_widget_items',
    'disqus_developer',
    'disqus_domain',
    'disqus_inherit_login',
    'disqus_localization',
    'disqus_location',
    'disqus_logo',
    'disqus_nodetypes',
    'disqus_nodetypes_default',
    'disqus_popular_threads_items',
    'disqus_publickey',
    'disqus_recent_comments_avatarsize',
    'disqus_recent_comments_excerpt_length',
    'disqus_recent_comments_items',
    'disqus_recent_comments_showavatars',
    'disqus_secretkey',
    'disqus_sso',
    'disqus_top_commenters_avatarsize',
    'disqus_top_commenters_hide_mods',
    'disqus_top_commenters_items',
    'disqus_top_commenters_showavatars',
    'disqus_track_newcomment_ga',
    'disqus_use_site_logo',
    'disqus_weight',
  );
  foreach ($variables as $variable) {
    variable_del($variable);
  }
}

/**
 * Updates from Drupal 6 to 7.
 */
function disqus_update_7000() {

  // Nothing.
}

/**
 * Updates Disqus with support for toggling comments per node.
 */
function disqus_update_7001() {
  if (!db_table_exists('disqus')) {
    drupal_install_schema('disqus');
  }
}

/**
 * Remove deprecated variable.
 */
function disqus_update_7002() {
  variable_del('disqus_userapikey');
}

Functions

Namesort descending Description
disqus_schema Implementation of hook_schema().
disqus_uninstall Implements hook_uninstall().
disqus_update_7000 Updates from Drupal 6 to 7.
disqus_update_7001 Updates Disqus with support for toggling comments per node.
disqus_update_7002 Remove deprecated variable.