From 1240b3f2e7e5766b1010273da5d7b71092d14564 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 28 Nov 2018 10:48:13 +1300 Subject: [PATCH] MDL-64237 mod_scorm: Remove large unused index from scorm_scoes_track --- mod/scorm/db/install.xml | 1 - mod/scorm/db/upgrade.php | 13 +++++++++++++ mod/scorm/version.php | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mod/scorm/db/install.xml b/mod/scorm/db/install.xml index ccd2f3e1905..9cb0b594ad8 100644 --- a/mod/scorm/db/install.xml +++ b/mod/scorm/db/install.xml @@ -105,7 +105,6 @@ - diff --git a/mod/scorm/db/upgrade.php b/mod/scorm/db/upgrade.php index 0ac2aa1c754..cbc7db2a2b2 100644 --- a/mod/scorm/db/upgrade.php +++ b/mod/scorm/db/upgrade.php @@ -81,5 +81,18 @@ function xmldb_scorm_upgrade($oldversion) { // Automatically generated Moodle v3.6.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2018123100) { + + // Remove un-used/large index on element field. + $table = new xmldb_table('scorm_scoes_track'); + $index = new xmldb_index('element', XMLDB_INDEX_UNIQUE, ['element']); + if ($dbman->index_exists($table, $index)) { + $dbman->drop_index($table, $index); + } + + // Scorm savepoint reached. + upgrade_mod_savepoint(true, 2018123100, 'scorm'); + } + return true; } diff --git a/mod/scorm/version.php b/mod/scorm/version.php index 1ab3ec1c280..f87996bb8ac 100644 --- a/mod/scorm/version.php +++ b/mod/scorm/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2018120300; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2018123100; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2018112800; // Requires this Moodle version. $plugin->component = 'mod_scorm'; // Full name of the plugin (used for diagnostics). \ No newline at end of file