You are here

contact.install in Drupal 5

Same filename and directory in other branches
  1. 6 modules/contact/contact.install
  2. 7 modules/contact/contact.install

File

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

/**
 * Implementation of hook_install().
 */
function contact_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {contact} (\n        cid int unsigned NOT NULL auto_increment,\n        category varchar(255) NOT NULL default '',\n        recipients longtext NOT NULL,\n        reply longtext NOT NULL,\n        weight tinyint NOT NULL default '0',\n        selected tinyint NOT NULL default '0',\n        PRIMARY KEY (cid),\n        UNIQUE KEY category (category)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {contact} (\n        cid serial CHECK (cid >= 0),\n        category varchar(255) NOT NULL default '',\n        recipients text NOT NULL default '',\n        reply text NOT NULL default '',\n        weight smallint NOT NULL default '0',\n        selected smallint NOT NULL default '0',\n        PRIMARY KEY (cid),\n        UNIQUE (category)\n      )");
      break;
  }
}

/**
 * Implementation of hook_uninstall().
 */
function contact_uninstall() {
  db_query('DROP TABLE {contact}');
  variable_del('contact_default_status');
  variable_del('contact_form_information');
  variable_del('contact_hourly_threshold');
}

Functions

Namesort descending Description
contact_install Implementation of hook_install().
contact_uninstall Implementation of hook_uninstall().