You are here

dynamic_background_blog.install in Dynamic Background 6

Installes the database scheme and handles install and uninstall of the module.

File

modules/dynamic_background_blog/dynamic_background_blog.install
View source
<?php

/**
 * @file
 * Installes the database scheme and handles install and uninstall of the
 * module.
 */

/**
 * Implementation of hook_schema(), which implementes the table
 * dynamic_background_node that holds information about about the pr. node
 * selected image.
 *
 * @return array $schema
 */
function dynamic_background_blog_schema() {
  $schema = array();
  $schema['dynamic_background_blog'] = array(
    'description' => t(''),
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'image_id' => array(
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'uid',
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function dynamic_background_blog_install() {
  drupal_install_schema('dynamic_background_blog');
}

/**
 * Implementation of hook_uninstall():
 */
function dynamic_background_blog_uninstall() {

  // Remove database table.
  drupal_uninstall_schema('dynamic_background_blog');

  // Remove settings.
  variable_del('dynamic_background_blog_css');
  variable_del('dynamic_background_blog_imagecache');
}

Functions

Namesort descending Description
dynamic_background_blog_install Implementation of hook_install().
dynamic_background_blog_schema Implementation of hook_schema(), which implementes the table dynamic_background_node that holds information about about the pr. node selected image.
dynamic_background_blog_uninstall Implementation of hook_uninstall():