function book_install in Drupal 5
Same name and namespace in other branches
- 6 modules/book/book.install \book_install()
- 7 modules/book/book.install \book_install()
Implementation of hook_install().
File
- modules/
book/ book.install, line 6
Code
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;
}
}