From: mjollnir_ Date: Thu, 18 Nov 2004 02:39:16 +0000 (+0000) Subject: Replaced prefix_ with CFG->prefix for DROP of indexes before creation because of... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=782fe16bbc4336c9a444618e83b838649ea4fa99;p=moodle.git Replaced prefix_ with CFG->prefix for DROP of indexes before creation because of being inside execute_sql rather than modify_database - choice module --- diff --git a/mod/choice/db/mysql.php b/mod/choice/db/mysql.php index 68438233db..839e4d335d 100644 --- a/mod/choice/db/mysql.php +++ b/mod/choice/db/mysql.php @@ -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);'); diff --git a/mod/choice/db/postgres7.php b/mod/choice/db/postgres7.php index 4c126e2d9c..a2e57dac4e 100644 --- a/mod/choice/db/postgres7.php +++ b/mod/choice/db/postgres7.php @@ -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);');