From b8c4c975e0c74cdbefb9024d46530d0d405da597 Mon Sep 17 00:00:00 2001 From: anisa kusumadewi Date: Thu, 19 May 2022 16:01:57 +0200 Subject: [PATCH] MDL-75766 core_h5p: Added index for pathnamehash to h5p table --- lib/db/install.xml | 5 ++++- lib/db/upgrade.php | 11 +++++++++++ version.php | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) mode change 100644 => 100755 lib/db/install.xml diff --git a/lib/db/install.xml b/lib/db/install.xml old mode 100644 new mode 100755 index c81044da8c7..dde051366f5 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -4237,6 +4237,9 @@ + + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index d24776ac519..9fda60ac5dd 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2731,5 +2731,16 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2021051710.03); } + if ($oldversion < 2021051710.14) { + $table = new xmldb_table('h5p'); + $indexpathnamehash = new xmldb_index('pathnamehash_idx', XMLDB_INDEX_NOTUNIQUE, ['pathnamehash']); + + if (!$dbman->index_exists($table, $indexpathnamehash)) { + $dbman->add_index($table, $indexpathnamehash); + } + // Main savepoint reached. + upgrade_main_savepoint(true, 2021051710.14); + } + return true; } diff --git a/version.php b/version.php index 0e8588c109c..2a01dece8e7 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2021051710.13; // 20210517 = branching date YYYYMMDD - do not modify! +$version = 2021051710.14; // 20210517 = branching date YYYYMMDD - do not modify! // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '3.11.10+ (Build: 20221104)';// Human-friendly version name