duplicate.install in Spam 5.3
File
filters/duplicate/duplicate.install
View source
<?php
function duplicate_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
default:
db_query("CREATE TABLE {spam_duplicate} (\n iid INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n sid INT(11) UNSIGNED NOT NULL DEFAULT '0',\n content_hash CHAR(32) NOT NULL DEFAULT '',\n hostname VARCHAR(15) NOT NULL DEFAULT '',\n duplicate_hash INT(11) NOT NULL DEFAULT '0',\n duplicate_ip INT(11) NOT NULL DEFAULT '0',\n spam TINYINT NOT NULL DEFAULT '0',\n expired TINYINT NOT NULL DEFAULT '0',\n timestamp INT(11) UNSIGNED DEFAULT '0',\n PRIMARY KEY (iid),\n KEY (sid),\n KEY (content_hash),\n KEY (hostname),\n KEY (spam),\n KEY (timestamp)\n ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case 'pgsql':
db_query("CREATE TABLE {spam_duplicate} (\n iid SERIAL,\n sid int_unsigned NOT NULL DEFAULT 0,\n content_hash CHAR(32) NOT NULL DEFAULT '',\n hostname VARCHAR(15) NOT NULL DEFAULT '',\n duplicate_hash INTEGER NOT NULL DEFAULT 0,\n duplicate_ip INTEGER NOT NULL DEFAULT 0,\n spam INTEGER NOT NULL DEFAULT 0,\n expired INTEGER NOT NULL DEFAULT 0,\n timestamp int_unsigned NOT NULL DEFAULT 0,\n PRIMARY KEY (iid)\n );");
db_query("CREATE INDEX {spam_duplicate}_sid_idx ON {spam_duplicate} (sid);");
db_query("CREATE INDEX {spam_duplicate}_content_hash_idx ON {spam_duplicate} (content_hash);");
db_query("CREATE INDEX {spam_duplicate}_hostname_idx ON {spam_duplicate} (hostname);");
db_query("CREATE INDEX {spam_duplicate}_spam_idx ON {spam_duplicate} (spam);");
db_query("CREATE INDEX {spam_duplicate}_timestamp_idx ON {spam_duplicate} (timestamp);");
break;
}
}
function duplicate_uninstall() {
db_query('DROP TABLE {spam_duplicate}');
drupal_set_message('The spam_duplicate table has been dropped.');
}