You are here

function httpbl_install in http:BL 5

Same name and namespace in other branches
  1. 6.2 httpbl.install \httpbl_install()
  2. 6 httpbl.install \httpbl_install()

Implementation of hook_install().

File

./httpbl.install, line 6

Code

function httpbl_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {httpbl} (\n        hostname varchar(128) NOT NULL,\n        status tinyint(2) NOT NULL default '0',\n        expire int(11) NOT NULL default '0',\n        PRIMARY KEY (hostname),\n        INDEX (expire)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {httpbl} (\n        hostname varchar(128) NOT NULL PRIMARY KEY,\n        status smallint NOT NULL default 0,\n        expire int NOT NULL default 0\n        );");
      db_query("CREATE INDEX {httpbl}_expire_idx on {httpbl} (expire);");
      break;
  }
}