You are here

forum.install in Drupal 5

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

File

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

/**
 * Implementation of hook_install().
 */
function forum_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {forum} (\n        nid int unsigned NOT NULL default '0',\n        vid int unsigned NOT NULL default '0',\n        tid int unsigned NOT NULL default '0',\n        PRIMARY KEY (vid),\n        KEY nid (nid),\n        KEY tid (tid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {forum} (\n        nid int_unsigned NOT NULL default '0',\n        vid int_unsigned NOT NULL default '0',\n        tid int_unsigned NOT NULL default '0',\n        PRIMARY KEY (vid)\n      )");
      db_query("CREATE INDEX {forum}_nid_idx ON {forum} (nid)");
      db_query("CREATE INDEX {forum}_tid_idx ON {forum} (tid)");
      break;
  }
}

/**
 * Implementation of hook_uninstall().
 */
function forum_uninstall() {
  db_query('DROP TABLE {forum}');
  variable_del('forum_containers');
  variable_del('forum_nav_vocabulary');
  variable_del('forum_hot_topic');
  variable_del('forum_per_page');
  variable_del('forum_order');
  variable_del('forum_block_num_0');
  variable_del('forum_block_num_1');
}

Functions

Namesort descending Description
forum_install Implementation of hook_install().
forum_uninstall Implementation of hook_uninstall().