You are here

function contact_install in Drupal 5

Same name and namespace in other branches
  1. 6 modules/contact/contact.install \contact_install()
  2. 7 modules/contact/contact.install \contact_install()

Implementation of hook_install().

File

modules/contact/contact.install, line 6

Code

function contact_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {contact} (\n        cid int unsigned NOT NULL auto_increment,\n        category varchar(255) NOT NULL default '',\n        recipients longtext NOT NULL,\n        reply longtext NOT NULL,\n        weight tinyint NOT NULL default '0',\n        selected tinyint NOT NULL default '0',\n        PRIMARY KEY (cid),\n        UNIQUE KEY category (category)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {contact} (\n        cid serial CHECK (cid >= 0),\n        category varchar(255) NOT NULL default '',\n        recipients text NOT NULL default '',\n        reply text NOT NULL default '',\n        weight smallint NOT NULL default '0',\n        selected smallint NOT NULL default '0',\n        PRIMARY KEY (cid),\n        UNIQUE (category)\n      )");
      break;
  }
}