You are here

ad_weight_percent.install in Advertisement 6.3

File

weight/percent/ad_weight_percent.install
View source
<?php

/**
 * Ad weight percent module database schema.
 * Copyright (c) 2007-2009
 *   Jeremy Andrews <jeremy@tag1consulting.com>.
 */

/**
 * Installation of the ad_weight_percent schema.
 */
function ad_weight_percent_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
    default:
      db_query("CREATE TABLE {ad_weight_percent} (\n        tid INT NOT NULL DEFAULT '0',\n        aid INT NOT NULL DEFAULT '0',\n        weight INT(3) NOT NULL DEFAULT '0',\n\n        UNIQUE KEY (tid, aid))");
  }
}

/**
 * Complete uninstallation of the ad_weight_percent module.
 */
function ad_weight_percent_uninstall() {

  // Remove tables.
  drupal_uninstall_schema('ad_weight_percent');
  drupal_set_message(t('The ad_weight_percent module has been completely uninstalled.'));
}

Functions

Namesort descending Description
ad_weight_percent_install Installation of the ad_weight_percent schema.
ad_weight_percent_uninstall Complete uninstallation of the ad_weight_percent module.