From f5583e97185ed57bb47ffe6ee0cbf36730775645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Monlla=C3=B3?= Date: Thu, 5 Sep 2019 13:31:11 +0800 Subject: [PATCH] MDL-66599 analytics: New index for analytics_used_analysables --- lib/db/install.xml | 5 +++-- lib/db/upgrade.php | 15 +++++++++++++++ version.php | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index a7f83864fb3..b762bfcf675 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -4019,6 +4019,7 @@ + @@ -4132,4 +4133,4 @@
-
+ \ No newline at end of file diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 1aa73b815c8..e27c0490046 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -3536,5 +3536,20 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2019083000.04); } + if ($oldversion < 2019090500.01) { + + // Define index analysableid (not unique) to be added to analytics_used_analysables. + $table = new xmldb_table('analytics_used_analysables'); + $index = new xmldb_index('analysableid', XMLDB_INDEX_NOTUNIQUE, ['analysableid']); + + // Conditionally launch add index analysableid. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2019090500.01); + } + return true; } diff --git a/version.php b/version.php index 7c57773b4b4..07689510546 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2019090500.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2019090500.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.