46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
<?php
|
|
// $Id$
|
|
|
|
/**
|
|
* Implementation of hook_install().
|
|
*/
|
|
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 default '',
|
|
reply longtext NOT NULL default '',
|
|
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;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Implementation of hook_uninstall().
|
|
*/
|
|
function contact_uninstall() {
|
|
db_query('DROP TABLE {contact}');
|
|
variable_del('contact_default_status');
|
|
variable_del('contact_form_information');
|
|
variable_del('contact_hourly_threshold');
|
|
}
|