book_install

Definition

book_install()
modules/book/book.install, line 6

Description

Implementation of hook_install().

Code

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

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.