You are here

function forum_install in Drupal 5

Same name and namespace in other branches
  1. 8 core/modules/forum/forum.install \forum_install()
  2. 6 modules/forum/forum.install \forum_install()
  3. 7 modules/forum/forum.install \forum_install()
  4. 9 core/modules/forum/forum.install \forum_install()

Implementation of hook_install().

File

modules/forum/forum.install, line 6

Code

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;
  }
}