From 6330c482bd26e084b43cfb13e28e13b66f50e006 Mon Sep 17 00:00:00 2001 From: anisa kusumadewi Date: Thu, 19 May 2022 16:01:57 +0200 Subject: [PATCH] MDL-71129 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 39c44669cf3..12e63fa531c --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -4364,6 +4364,9 @@ + + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index afa05ac6cc2..784f41923df 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2903,5 +2903,16 @@ privatefiles,moodle|/user/files.php'; upgrade_main_savepoint(true, 2022081200.01); } + if ($oldversion < 2022091000.01) { + $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, 2022091000.01); + } + return true; } diff --git a/version.php b/version.php index 6b655406c98..75f8a675b9b 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2022091000.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2022091000.01; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '4.1dev (Build: 20220910)'; // Human-friendly version name