Skip to content
Browse files

Indexes and version bump for dialogue

  • Loading branch information...
1 parent b53f6cb commit a12772c2926191d684670d7fa77cfc95302511fc mjollnir_ committed Nov 18, 2004
View
10 mod/dialogue/db/mysql.php
@@ -14,7 +14,15 @@ function dialogue_upgrade($oldversion) {
if ($oldversion < 2003101300) {
execute_sql(" ALTER TABLE `{$CFG->prefix}dialogue_conversations` ADD `seenon` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `closed`");
}
-
+
+ if ($oldversion < 2004111000) {
+ modify_database('','ALTER TABLE prefix_dialogue ADD KEY course (course);');
+ modify_database('','ALTER TABLE prefix_dialogue_conversations ADD KEY recipientid (recipientid);');
+ modify_database('','ALTER TABLE prefix_dialogue_conversations ADD KEY userid (userid);');
+ modify_database('','ALTER TABLE prefix_dialogue_entries ADD KEY dialogueid (dialogueid);');
+ modify_database('','ALTER TABLE prefix_dialogue_entries ADD KEY userid (userid);');
+ }
+
$result = true;
return $result;
}
View
13 mod/dialogue/db/mysql.sql
@@ -30,7 +30,8 @@ CREATE TABLE prefix_dialogue (
timemodified int(10) unsigned NOT NULL default '0',
name varchar(255) default NULL,
intro text,
- PRIMARY KEY (id)
+ PRIMARY KEY (id),
+ KEY course (course)
) TYPE=MyISAM;
# --------------------------------------------------------
@@ -51,8 +52,10 @@ CREATE TABLE prefix_dialogue_conversations (
format tinyint(2) NOT NULL default '0',
subject varchar(100) not null default '',
PRIMARY KEY (id),
- KEY (dialogueid),
- KEY (timemodified)
+ KEY dialogueid (dialogueid),
+ KEY timemodified (timemodified),
+ KEY userid (userid),
+ KEY recipientid (recipientid)
) TYPE=MyISAM COMMENT='All the conversations between pairs of people';
#
@@ -68,7 +71,9 @@ CREATE TABLE prefix_dialogue_entries (
mailed int(1) unsigned NOT NULL default '0',
text text NOT NULL,
PRIMARY KEY (id),
- KEY (conversationid)
+ KEY conversationid (conversationid),
+ KEY dialogueid (dialogueid),
+ KEY userid (userid)
) TYPE=MyISAM COMMENT='All the conversation entries';
#
View
8 mod/dialogue/db/postgres7.php
@@ -6,6 +6,14 @@ function dialogue_upgrade($oldversion) {
global $CFG;
+ if ($oldversion < 2004111000) {
+ modify_database('','CREATE INDEX prefix_dialogue_course_idx ON prefix_dialogue (course);');
+ modify_database('','CREATE INDEX prefix_dialogue_conversations_userid_idx ON prefix_dialogue_conversations (userid);');
+ modify_database('','CREATE INDEX prefix_dialogue_conversations_recipientid_idx ON prefix_dialogue_conversations (recipientid);');
+ modify_database('','CREATE INDEX prefix_dialogue_entries_dialogueid_idx ON prefix_dialogue_entries (dialogueid);');
+ modify_database('','CREATE INDEX prefix_dialogue_entries_userid_idx ON prefix_dialogue_entries (userid);');
+ }
+
$result = true;
return $result;
}
View
8 mod/dialogue/db/postgres7.sql
@@ -31,6 +31,10 @@ CREATE TABLE prefix_dialogue (
name varchar(255) default NULL,
intro text
) ;
+
+CREATE INDEX prefix_dialogue_course_idx ON prefix_dialogue (course);
+
+
# --------------------------------------------------------
#
@@ -52,6 +56,8 @@ CREATE TABLE prefix_dialogue_conversations (
) ;
CREATE INDEX prefix_dialogue_conversations_timemodified_idx ON prefix_dialogue_conversations (timemodified) ;
CREATE INDEX prefix_dialogue_conversations_dialogueid_idx ON prefix_dialogue_conversations (dialogueid) ;
+CREATE INDEX prefix_dialogue_conversations_userid_idx ON prefix_dialogue_conversations (userid);
+CREATE INDEX prefix_dialogue_conversations_recipientid_idx ON prefix_dialogue_conversations (recipientid);
#
# Table structure for table dialogue_entries
@@ -67,6 +73,8 @@ CREATE TABLE prefix_dialogue_entries (
text text NOT NULL default ''
) ;
CREATE INDEX prefix_dialogue_entries_conversationid_idx ON prefix_dialogue_entries (conversationid) ;
+CREATE INDEX prefix_dialogue_entries_dialogueid_idx ON prefix_dialogue_entries (dialogueid);
+CREATE INDEX prefix_dialogue_entries_userid_idx ON prefix_dialogue_entries (userid);
#
# Data for the table log_display
View
2 mod/dialogue/version.php
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2004060400;
+$module->version = 2004111000;
$module->requires = 2004052505; // Requires this Moodle version
$module->cron = 60;

0 comments on commit a12772c

Please sign in to comment.
Something went wrong with that request. Please try again.