From a2179f028c2a1ad0459fdac26c582a030efd85ab Mon Sep 17 00:00:00 2001 From: Alex Morris Date: Thu, 12 Jan 2023 13:36:15 +1300 Subject: [PATCH] MDL-78072 lib/db: Add new publickey field to user_devices table Backport of MDL-76722. Co-authored by: Andrew Lyons --- lib/db/install.xml | 1 + lib/db/upgrade.php | 13 +++++++++++++ version.php | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index 1e719c7a844..13a1712da0d 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -3385,6 +3385,7 @@ + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 6b299b1ee95..296f0427e4f 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -3051,5 +3051,18 @@ privatefiles,moodle|/user/files.php'; upgrade_main_savepoint(true, 2022112800.03); } + if ($oldversion < 2022112803.03) { + // Add public key field to user_devices table. + $table = new xmldb_table('user_devices'); + $field = new xmldb_field('publickey', XMLDB_TYPE_TEXT, null, null, null, null, null, 'enable'); + + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2022112803.03); + } + return true; } diff --git a/version.php b/version.php index 684c34415fe..989ed077a2a 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2022112803.02; // 20221128 = branching date YYYYMMDD - do not modify! +$version = 2022112803.03; // 20221128 = branching date YYYYMMDD - do not modify! // RR = release increments - 00 in DEV branches. // .XX = incremental changes. $release = '4.1.3+ (Build: 20230504)'; // Human-friendly version name