Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Indexes and version bump for choice

  • Loading branch information...
commit b53f6cbec484c057b08e671ed553515123798632 1 parent 7bf8395
mjollnir_ authored
View
6 mod/choice/db/mysql.php
@@ -43,6 +43,12 @@ function choice_upgrade($oldversion) {
modify_database("", "UPDATE prefix_choice SET publish = publish - 1 WHERE publish > 0;");
}
+ if ($oldversion < 2004111200){
+ modify_database('','ALTER TABLE prefix_choice ADD INDEX course (course);');
+ modify_database('','ALTER TABLE prefix_choice_answers ADD INDEX choice (choice);');
+ modify_database('','ALTER TABLE prefix_choice_answers ADD INDEX userid (userid);');
+
+ }
return true;
}
View
7 mod/choice/db/mysql.sql
@@ -34,7 +34,8 @@ CREATE TABLE prefix_choice (
timeclose int(10) unsigned NOT NULL default '0',
timemodified int(10) unsigned NOT NULL default '0',
PRIMARY KEY (id),
- UNIQUE KEY id (id)
+ UNIQUE KEY id (id),
+ KEY course (course)
) TYPE=MyISAM COMMENT='Available choices are stored here.';
@@ -51,7 +52,9 @@ CREATE TABLE prefix_choice_answers (
answer tinyint(4) NOT NULL default '0',
timemodified int(10) NOT NULL default '0',
PRIMARY KEY (id),
- UNIQUE KEY id (id)
+ UNIQUE KEY id (id),
+ KEY userid (userid),
+ KEY choice (choice)
) TYPE=MyISAM;
#
View
6 mod/choice/db/postgres7.php
@@ -29,6 +29,12 @@ function choice_upgrade($oldversion) {
modify_database("", "UPDATE prefix_choice SET publish = publish - 1 WHERE publish > 0;");
}
+ if ($oldversion < 2004111200) {
+ modify_database('','CREATE INDEX prefix_choice_course_idx ON prefix_choice (course);');
+ modify_database('','CREATE INDEX prefix_choice_answers_choice_idx ON prefix_choice_answers (choice);');
+ modify_database('','CREATE INDEX prefix_choice_answers_userid_idx ON prefix_choice_answers (userid);');
+ }
+
return true;
}
View
4 mod/choice/db/postgres7.sql
@@ -35,6 +35,7 @@ CREATE TABLE prefix_choice (
timemodified integer NOT NULL default '0'
);
+CREATE INDEX prefix_choice_course_idx ON prefix_choice (course);
# --------------------------------------------------------
@@ -50,6 +51,9 @@ CREATE TABLE prefix_choice_answers (
timemodified integer NOT NULL default '0'
);
+CREATE INDEX prefix_choice_answers_choice_idx ON prefix_choice_answers (choice);
+CREATE INDEX prefix_choice_answers_userid_idx ON prefix_choice_answers (userid);
+
#
# Dumping data for table `log_display`
#
View
2  mod/choice/version.php
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2004070102;
+$module->version = 2004111200;
$module->requires = 2004052505; // Requires this Moodle version
$module->cron = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.