contact_install

Versions
5 – 7
contact_install()

Implementation of hook_install().

Code

modules/contact/contact.install, line 6

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

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.