Imported drupal-5.3
[drupal.git] / modules / contact / contact.install
blobab452d851919754186be0adca5fdc8bd8c804614
1 <?php
2 // $Id: contact.install,v 1.6 2007/01/02 05:30:29 drumm Exp $
4 /**
5  * Implementation of hook_install().
6  */
7 function contact_install() {
8   switch ($GLOBALS['db_type']) {
9     case 'mysql':
10     case 'mysqli':
11       db_query("CREATE TABLE {contact} (
12         cid int unsigned NOT NULL auto_increment,
13         category varchar(255) NOT NULL default '',
14         recipients longtext NOT NULL,
15         reply longtext NOT NULL,
16         weight tinyint NOT NULL default '0',
17         selected tinyint NOT NULL default '0',
18         PRIMARY KEY (cid),
19         UNIQUE KEY category (category)
20       ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
21       break;
22     case 'pgsql':
23       db_query("CREATE TABLE {contact} (
24         cid serial CHECK (cid >= 0),
25         category varchar(255) NOT NULL default '',
26         recipients text NOT NULL default '',
27         reply text NOT NULL default '',
28         weight smallint NOT NULL default '0',
29         selected smallint NOT NULL default '0',
30         PRIMARY KEY (cid),
31         UNIQUE (category)
32       )");
33       break;
34   }
37 /**
38  * Implementation of hook_uninstall().
39  */
40 function contact_uninstall() {
41   db_query('DROP TABLE {contact}');
42   variable_del('contact_default_status');
43   variable_del('contact_form_information');
44   variable_del('contact_hourly_threshold');