[phpmix-cvs] drupal/modules/akismet akismet.install,1.1,1.2
Status: Pre-Alpha
Brought to you by:
markus_petrux
From: <php...@li...> - 2006-06-10 17:50:09
|
Update of /cvsroot/phpmix/drupal/modules/akismet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11323 Modified Files: akismet.install Log Message: Added new table for user extensions (email options). Index: akismet.install =================================================================== RCS file: /cvsroot/phpmix/drupal/modules/akismet/akismet.install,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** akismet.install 4 Jun 2006 00:52:45 -0000 1.1 --- akismet.install 10 Jun 2006 17:50:00 -0000 1.2 *************** *** 6,9 **** --- 6,11 ---- */ function akismet_install() { + $ret = array(); + switch ($GLOBALS['db_type']) { case 'mysql': *************** *** 16,19 **** --- 18,27 ---- INDEX spam_created (spam_created) ) /*!40100 DEFAULT CHARACTER SET utf8 */;"); + db_query("CREATE TABLE {akismet_user} ( + uid int(10) unsigned NOT NULL default 0, + email_for varchar(20) NOT NULL default '', + PRIMARY KEY (uid), + INDEX email_for (email_for) + ) /*!40100 DEFAULT CHARACTER SET utf8 */;"); break; *************** *** 21,32 **** db_query("CREATE TABLE {akismet_spam_marks} ( content_type varchar(20) NOT NULL default '', ! content_id integer NOT NULL default 0, ! spam_created integer NOT NULL default 0, ! CHECK (content_id>=0), ! CHECK (spam_created>=0) )"); db_query("CREATE UNIQUE INDEX {akismet_spam_marks_content} ON {akismet_spam_marks} (content_type, content_id)"); db_query("CREATE INDEX {akismet_spam_marks_spamcreated} ON {akismet_spam_marks} (spam_created)"); break; } } --- 29,76 ---- db_query("CREATE TABLE {akismet_spam_marks} ( content_type varchar(20) NOT NULL default '', ! content_id integer NOT NULL default 0 CHECK (content_id >= 0), ! spam_created integer NOT NULL default 0 CHECK (spam_created >= 0) )"); db_query("CREATE UNIQUE INDEX {akismet_spam_marks_content} ON {akismet_spam_marks} (content_type, content_id)"); db_query("CREATE INDEX {akismet_spam_marks_spamcreated} ON {akismet_spam_marks} (spam_created)"); + db_query("CREATE TABLE {akismet_user} ( + uid INTEGER NOT NULL DEFAULT 0 CHECK (uid >= 0), + email_for VARCHAR(20) NOT NULL DEFAULT '', + PRIMARY KEY (uid) + )"); + db_query("CREATE INDEX {akismet_user_email_for} ON {akismet_user} (email_for)"); + break; + } + + return $ret; + } + + /** + * Update 1: Add table for user extensions. + */ + function akismet_update_1() { + $ret = array(); + + switch ($GLOBALS['db_type']) { + case 'mysql': + case 'mysqli': + $ret[] = update_sql("CREATE TABLE {akismet_user} ( + uid int(10) unsigned NOT NULL default 0, + email_for varchar(20) NOT NULL default '', + PRIMARY KEY (uid), + INDEX email_for (email_for) + ) /*!40100 DEFAULT CHARACTER SET utf8 */;"); + break; + + case 'pgsql': + $ret[] = update_sql("CREATE TABLE {akismet_user} ( + uid INTEGER NOT NULL DEFAULT 0 CHECK (uid >= 0), + email_for VARCHAR(20) NOT NULL DEFAULT '', + PRIMARY KEY (uid) + )"); + $ret[] = update_sql("CREATE INDEX {akismet_user_email_for} ON {akismet_user} (email_for)"); break; } + + return $ret; } |