Replaced prefix_ with CFG->prefix for DROP of indexes before creation because of being inside execute_sql rather than modify_database - choice module

This commit is contained in:
mjollnir_
2004-11-18 02:39:16 +00:00
parent 756fe81e15
commit 782fe16bbc
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -44,9 +44,9 @@ function choice_upgrade($oldversion) {
}
if ($oldversion < 2004111200){ // drop first to avoid conflicts when upgrading from 1.4+
execute_sql('ALTER TABLE prefix_choice DROP INDEX course;',false);
execute_sql('ALTER TABLE prefix_choice_answers DROP INDEX choice;',false);
execute_sql('ALTER TABLE prefix_choice_answers DROP INDEX userid;',false);
execute_sql("ALTER TABLE {$CFG->prefix}choice DROP INDEX course;",false);
execute_sql("ALTER TABLE {$CFG->prefix}choice_answers DROP INDEX choice;",false);
execute_sql("ALTER TABLE {$CFG->prefix}choice_answers DROP INDEX userid;",false);
modify_database('','ALTER TABLE prefix_choice ADD INDEX course (course);');
modify_database('','ALTER TABLE prefix_choice_answers ADD INDEX choice (choice);');
+3 -3
View File
@@ -30,9 +30,9 @@ function choice_upgrade($oldversion) {
}
if ($oldversion < 2004111200) { // drop first to avoid conflicts when upgrading from 1.4+
execute_sql('DROP INDEX prefix_choice_course_idx;',false);
execute_sql('DROP INDEX prefix_choice_answers_choice_idx;',false);
execute_sql('DROP INDEX prefix_choice_answers_userid_idx;',false);
execute_sql("DROP INDEX {$CFG->prefix}choice_course_idx;",false);
execute_sql("DROP INDEX {$CFG->prefix}choice_answers_choice_idx;",false);
execute_sql("DROP INDEX {$CFG->prefix}choice_answers_userid_idx;",false);
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);');