From 0410cee69e76646331fa14735abf9d9a8e7c5f29 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Tue, 2 Oct 2018 11:31:02 +0800 Subject: [PATCH 1/2] MDL-63493 core_message: Fix field parameters for the index definitions * The fields for the ID number-related indexes that were created for the messages and message_user_actions tables in MDL-36941 should not be in comma-separated strings. --- lib/db/upgrade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 7f6a1f11cb3..761dd125b63 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2167,7 +2167,7 @@ function xmldb_main_upgrade($oldversion) { $table = new xmldb_table('message_user_actions'); // Conditionally launch add index. - $index = new xmldb_index('userid_messageid_action', XMLDB_INDEX_UNIQUE, array('userid, messageid, action')); + $index = new xmldb_index('userid_messageid_action', XMLDB_INDEX_UNIQUE, array('userid', 'messageid', 'action')); if (!$dbman->index_exists($table, $index)) { $dbman->add_index($table, $index); } @@ -2181,7 +2181,7 @@ function xmldb_main_upgrade($oldversion) { $table = new xmldb_table('messages'); // Conditionally launch add index. - $index = new xmldb_index('conversationid_timecreated', XMLDB_INDEX_NOTUNIQUE, array('conversationid, timecreated')); + $index = new xmldb_index('conversationid_timecreated', XMLDB_INDEX_NOTUNIQUE, array('conversationid', 'timecreated')); if (!$dbman->index_exists($table, $index)) { $dbman->add_index($table, $index); } From b79482f5d7e453310eff2184f3f31bd84dd777a5 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Tue, 2 Oct 2018 09:33:35 +0800 Subject: [PATCH 2/2] MDL-63493 core_question: Fix field parameters for the index definitions * The fields for the ID number-related indexes that were created for the question and question_categories tables in MDL-62708 should not be in comma-separated strings. --- lib/db/upgrade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 761dd125b63..dfb7aff50cd 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2373,7 +2373,7 @@ function xmldb_main_upgrade($oldversion) { if ($oldversion < 2018092100.02) { $table = new xmldb_table('question'); - $index = new xmldb_index('categoryidnumber', XMLDB_INDEX_UNIQUE, array('category, idnumber')); + $index = new xmldb_index('categoryidnumber', XMLDB_INDEX_UNIQUE, array('category', 'idnumber')); if (!$dbman->index_exists($table, $index)) { $dbman->add_index($table, $index); } @@ -2391,7 +2391,7 @@ function xmldb_main_upgrade($oldversion) { if ($oldversion < 2018092100.04) { $table = new xmldb_table('question_categories'); - $index = new xmldb_index('contextididnumber', XMLDB_INDEX_UNIQUE, array('contextid, idnumber')); + $index = new xmldb_index('contextididnumber', XMLDB_INDEX_UNIQUE, array('contextid', 'idnumber')); if (!$dbman->index_exists($table, $index)) { $dbman->add_index($table, $index); }