You are here

function lineage_install in Taxonomy Lineage 5

Same name and namespace in other branches
  1. 6 lineage.install \lineage_install()

File

./lineage.install, line 3

Code

function lineage_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {term_lineage} ( " . "tid int(10) unsigned NOT NULL default '0', " . "lineage varchar(255) NOT NULL default '', " . "depth int(10), " . "KEY tid (tid), " . "KEY lineage (lineage) " . ") /*!40100 DEFAULT CHARACTER SET utf8 */");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {term_lineage} ( " . "tid integer NOT NULL default '0', " . "lineage varchar(255) NOT NULL default '', " . "depth integer NOT NULL default '' " . ")");
      db_query("CREATE INDEX {term_lineage}_tid_idx ON {term_lineage}(tid)");
      db_query("CREATE INDEX {term_lineage}_lineage_idx ON {term_lineage}(lineage)");
      break;
  }
}