Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Indexes for survey and version bump (honoring partial freeze)

  • Loading branch information...
commit a1c0899be1b090790d092e4fb6b7b1135fae9170 1 parent 8a07a15
mjollnir_ authored
View
9 mod/survey/db/mysql.php
@@ -177,6 +177,15 @@ function survey_upgrade($oldversion) {
modify_database("", "INSERT INTO prefix_log_display VALUES ('survey', 'update', 'survey', 'name');");
}
+ if ($oldversion < 2004060401) {
+ modify_database('','ALTER TABLE prefix_survey ADD INDEX course (course);');
+ modify_database('','ALTER TABLE prefix_survey_analysis ADD INDEX survey (survey);');
+ modify_database('','ALTER TABLE prefix_survey_analysis ADD INDEX userid (userid);');
+ modify_database('','ALTER TABLE prefix_survey_answers ADD INDEX userid (userid);');
+ modify_database('','ALTER TABLE prefix_survey_answers ADD INDEX survey (survey);');
+ modify_database('','ALTER TABLE prefix_survey_answers ADD INDEX question (question);');
+ }
+
return true;
}
View
12 mod/survey/db/mysql.sql
@@ -24,7 +24,8 @@ CREATE TABLE prefix_survey (
name varchar(255) NOT NULL default '',
intro text,
questions varchar(255) default NULL,
- PRIMARY KEY (id)
+ PRIMARY KEY (id),
+ KEY `course` (`course`)
) TYPE=MyISAM COMMENT='all surveys';
#
@@ -49,7 +50,9 @@ CREATE TABLE prefix_survey_analysis (
userid int(10) unsigned NOT NULL default '0',
notes text NOT NULL,
PRIMARY KEY (id),
- UNIQUE KEY id (id)
+ UNIQUE KEY id (id),
+ KEY survey (survey),
+ KEY userid (userid)
) TYPE=MyISAM;
#
@@ -71,7 +74,10 @@ CREATE TABLE prefix_survey_answers (
answer1 text default NULL,
answer2 text default NULL,
PRIMARY KEY (id),
- UNIQUE KEY id (id)
+ UNIQUE KEY id (id),
+ KEY userid (userid),
+ KEY survey (survey),
+ KEY question (question)
) TYPE=MyISAM;
#
View
8 mod/survey/db/postgres7.php
@@ -24,6 +24,14 @@ function survey_upgrade($oldversion) {
modify_database("", "INSERT INTO prefix_log_display VALUES ('survey', 'update', 'survey', 'name');");
}
+ if ($oldversion < 2004060401) {
+ modify_database('','CREATE INDEX prefix_survey_course_idx ON prefix_survey (course);');
+ modify_database('','CREATE INDEX prefix_survey_analysis_survey_idx ON prefix_survey_analysis (survey);');
+ modify_database('','CREATE INDEX prefix_survey_analysis_userid_idx ON prefix_survey_analysis (userid);');
+ modify_database('','CREATE INDEX prefix_survey_answers_userid_idx ON prefix_survey_answers (userid);');
+ modify_database('','CREATE INDEX prefix_survey_answers_survey_idx ON prefix_survey_answers (survey);');
+ modify_database('','CREATE INDEX prefix_survey_answers_question_idx ON prefix_survey_answers (question);');
+ }
return true;
}
View
9 mod/survey/db/postgres7.sql
@@ -26,6 +26,8 @@ CREATE TABLE prefix_survey (
questions varchar(255) default NULL
);
+CREATE INDEX prefix_survey_course_idx ON prefix_survey (course);
+
#
# Dumping data for table survey
#
@@ -49,6 +51,9 @@ CREATE TABLE prefix_survey_analysis (
notes text NOT NULL default ''
);
+CREATE INDEX prefix_survey_analysis_survey_idx ON prefix_survey_analysis (survey);
+CREATE INDEX prefix_survey_analysis_userid_idx ON prefix_survey_analysis (userid);
+
#
# Dumping data for table survey_analysis
#
@@ -69,6 +74,10 @@ CREATE TABLE prefix_survey_answers (
answer2 text default NULL
);
+CREATE INDEX prefix_survey_answers_userid_idx ON prefix_survey_answers (userid);
+CREATE INDEX prefix_survey_answers_survey_idx ON prefix_survey_answers (survey);
+CREATE INDEX prefix_survey_answers_question_idx ON prefix_survey_answers (question);
+
#
# Dumping data for table survey_answers
#
View
2  mod/survey/version.php
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2004060400;
+$module->version = 2004060401;
$module->requires = 2004052505; // Requires this Moodle version
$module->cron = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.