You are here

book.install in Drupal 5

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

File

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

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

/**
 * Implementation of hook_uninstall().
 */
function book_uninstall() {
  db_query('DROP TABLE {book}');
}

Functions

Namesort descending Description
book_install Implementation of hook_install().
book_uninstall Implementation of hook_uninstall().