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

This commit is contained in:
Alex Morris 2023-01-12 13:36:15 +13:00 committed by Andrew Nicols
parent bd2de8edf6
commit 7c843b380b
3 changed files with 15 additions and 1 deletions

View File

@ -3389,6 +3389,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>

View File

@ -3215,5 +3215,18 @@ privatefiles,moodle|/user/files.php';
upgrade_main_savepoint(true, 2023032800.01);
}
if ($oldversion < 2023041100.00) {
// 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, 2023041100.00);
}
return true;
}

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2023040600.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2023041100.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.2dev+ (Build: 20230406)'; // Human-friendly version name