Permalink
Browse files

Postgres needs full longnames for indexes to prevent overlapping names.

  • Loading branch information...
1 parent 3565715 commit ea563f8f99e044546c4428c89acb2bf7adeabbcd paca70 committed May 3, 2003
Showing with 14 additions and 14 deletions.
  1. +3 −3 lib/db/postgres7.php
  2. +3 −3 lib/db/postgres7.sql
  3. +3 −3 mod/quiz/db/postgres7.php
  4. +5 −5 mod/quiz/db/postgres7.sql
View
@@ -123,8 +123,8 @@ function main_upgrade($oldversion=0) {
if ($oldversion < 2003042700) {
/// Changing to multiple indexes
- execute_sql(" CREATE INDEX coursemoduleaction ON {$CFG->prefix}log (course,module,action) ");
- execute_sql(" CREATE INDEX courseuserid ON {$CFG->prefix}log (course,userid) ");
+ execute_sql(" CREATE INDEX {$CFG->prefix}log_coursemoduleaction_idx ON {$CFG->prefix}log (course,module,action) ");
+ execute_sql(" CREATE INDEX {$CFG->prefix}log_courseuserid_idx ON {$CFG->prefix}log (course,userid) ");
}
if ($oldversion < 2003042801) {
@@ -135,7 +135,7 @@ function main_upgrade($oldversion=0) {
display integer NOT NULL default '0'
)");
- execute_sql("CREATE INDEX courseuserid ON {$CFG->prefix}course_display (course,userid)");
+ execute_sql("CREATE INDEX {$CFG->prefix}course_display_courseuserid_idx ON {$CFG->prefix}course_display (course,userid)");
}
return $result;
View
@@ -39,7 +39,7 @@ CREATE TABLE prefix_course_display (
display integer NOT NULL default '0'
);
-CREATE INDEX courseuserid ON prefix_course_display (course,userid);
+CREATE INDEX prefix_course_display_courseuserid_idx ON prefix_course_display (course,userid);
CREATE TABLE prefix_course_modules (
id SERIAL PRIMARY KEY,
@@ -73,9 +73,9 @@ CREATE TABLE prefix_log (
info varchar(255) NOT NULL default ''
);
-CREATE INDEX coursemoduleaction ON prefix_log (course,module,action);
+CREATE INDEX prefix_log_coursemoduleaction_idx ON prefix_log (course,module,action);
-CREATE INDEX courseuserid ON prefix_log (course,userid);
+CREATE INDEX prefix_log_courseuserid_idx ON prefix_log (course,userid);
CREATE TABLE prefix_log_display (
module varchar(20) NOT NULL default '',
@@ -35,7 +35,7 @@ function quiz_upgrade($oldversion) {
questiontext text NOT NULL default '',
answertext varchar(255) NOT NULL default ''
);");
- modify_database ("", "CREATE INDEX question_prefix_quiz_match_sub_idx ON prefix_quiz_match_sub (question);");
+ modify_database ("", "CREATE INDEX prefix_quiz_match_sub_question_idx ON prefix_quiz_match_sub (question);");
modify_database ("", "CREATE TABLE prefix_quiz_multichoice (
id SERIAL PRIMARY KEY,
@@ -44,7 +44,7 @@ function quiz_upgrade($oldversion) {
answers varchar(255) NOT NULL default '',
single integer NOT NULL default '0'
);");
- modify_database ("", "CREATE INDEX question_quiz_multichoice_idx ON prefix_quiz_multichoice (question);");
+ modify_database ("", "CREATE INDEX prefix_quiz_multichoice_question_idx ON prefix_quiz_multichoice (question);");
}
if ($oldversion < 2003040901) {
@@ -57,7 +57,7 @@ function quiz_upgrade($oldversion) {
question integer NOT NULL default '0',
subquestions varchar(255) NOT NULL default ''
);");
- modify_database ("", "CREATE INDEX question ON prefix_quiz_match (question);");
+ modify_database ("", "CREATE INDEX prefix_quiz_match_question_idx ON prefix_quiz_match (question);");
}
return true;
}
View
@@ -100,7 +100,7 @@ CREATE TABLE prefix_quiz_match (
subquestions varchar(255) NOT NULL default ''
);
# --------------------------------------------------------
-CREATE INDEX question_prefix_quiz_match_idx ON prefix_quiz_match (question);
+CREATE INDEX prefix_quiz_match_question_idx ON prefix_quiz_match (question);
#
# Table structure for table `quiz_match_sub`
@@ -113,7 +113,7 @@ CREATE TABLE prefix_quiz_match_sub (
answertext varchar(255) NOT NULL default ''
);
# --------------------------------------------------------
-CREATE INDEX question_prefix_quiz_match_sub_idx ON prefix_quiz_match_sub (question);
+CREATE INDEX prefix_quiz_match_sub_question_idx ON prefix_quiz_match_sub (question);
#
# Table structure for table quiz_multichoice
@@ -127,7 +127,7 @@ CREATE TABLE prefix_quiz_multichoice (
single integer NOT NULL default '0'
);
# --------------------------------------------------------
-CREATE INDEX question_quiz_multichoice_idx ON prefix_quiz_multichoice (question);
+CREATE INDEX prefix_quiz_multichoice_question_idx ON prefix_quiz_multichoice (question);
#
# Table structure for table quiz_question_grades
@@ -190,7 +190,7 @@ CREATE TABLE prefix_quiz_shortanswer (
usecase integer NOT NULL default '0'
);
# --------------------------------------------------------
-CREATE INDEX question_prefix_quiz_shortanswer_idx ON prefix_quiz_shortanswer (question);
+CREATE INDEX prefix_quiz_shortanswer_question_idx ON prefix_quiz_shortanswer (question);
#
# Table structure for table quiz_truefalse
@@ -202,7 +202,7 @@ CREATE TABLE prefix_quiz_truefalse (
trueanswer integer NOT NULL default '0',
falseanswer integer NOT NULL default '0'
);
-CREATE INDEX question_prefix_quiz_truefalse_idx ON prefix_quiz_truefalse (question);
+CREATE INDEX prefix_quiz_truefalse_question_idx ON prefix_quiz_truefalse (question);
INSERT INTO prefix_log_display VALUES ('quiz', 'view', 'quiz', 'name');

0 comments on commit ea563f8

Please sign in to comment.