You are here

nodehierarchy_views.install in Node Hierarchy 5

File

nodehierarchy_views/nodehierarchy_views.install
View source
<?php

// Create the database table on install (MySQL only for now)
function nodehierarchy_views_install() {
  if ($GLOBALS['db_type'] == 'mysqli' || $GLOBALS['db_type'] == 'mysql') {
    drupal_set_message("Creating required nodehierarchy_views.module MySQL tables for first install");
    db_query("CREATE TABLE {nodehierarchy_views} (\n      nid int(10) unsigned NOT NULL default '0',\n      nh_children_view varchar(32) NULL default NULL,\n      PRIMARY KEY (nid)\n    ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
  }
}
function nodehierarchy_views_uninstall() {
  db_query("DROP TABLE {nodehierarchy_views}");
}