MDL-78909 mod_lti: Add indexes in upgrade.php

This commit is contained in:
Ilya Tregubov 2023-09-11 15:06:35 +08:00 committed by Jake Dallimore
parent faa491fe3b
commit 787455198b
No known key found for this signature in database

View File

@ -150,6 +150,11 @@ function xmldb_lti_upgrade($oldversion) {
// Add key.
$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);
// Define index courseid (not unique) to be added to lti_coursevisible.
$table->add_index('courseid', XMLDB_INDEX_NOTUNIQUE, ['courseid']);
// Define index typeid (not unique) to be added to lti_coursevisible.
$table->add_index('typeid', XMLDB_INDEX_NOTUNIQUE, ['typeid']);
// Conditionally launch create table for overriding coursevisible.
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);