MDL-78072 lib/db: Add new publickey field to user_devices table

Backport of MDL-76722.

Co-authored by: Andrew Lyons <[email protected]>
This commit is contained in:
Alex Morris
2023-05-09 12:25:16 +08:00
committed by Andrew Nicols
parent 176a323b4e
commit a2179f028c
3 changed files with 15 additions and 1 deletions
+1
View File
@@ -3385,6 +3385,7 @@
<FIELD NAME="version" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="The device version, 6.1.2, 4.2.2 etc.."/>
<FIELD NAME="pushid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="the device PUSH token/key/identifier/registration id"/>
<FIELD NAME="uuid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The device vendor UUID"/>
<FIELD NAME="publickey" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="The app generated public key"/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
</FIELDS>
+13
View File
@@ -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;
}
+1 -1
View File
@@ -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