Skip to content

Commit

Permalink
Merge branch 'wip-106755-m401' into MOODLE_401_STABLE
Browse files Browse the repository at this point in the history
# Conflicts:
#	local/o365/db/upgrade.php
#	local/o365/version.php
  • Loading branch information
weilai-irl committed Oct 8, 2024
2 parents 84e165b + db7dbb2 commit e459c5e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
10 changes: 5 additions & 5 deletions local/o365/db/install.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="local/o365/db" VERSION="20240514" COMMENT="XMLDB file for Moodle local/o365 plugin"
<XMLDB PATH="local/o365/db" VERSION="20240927" COMMENT="XMLDB file for Moodle local/o365 plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
Expand Down Expand Up @@ -155,8 +155,8 @@
<TABLE NAME="local_o365_teams_cache" COMMENT="Stores Teams cache">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="objectid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="objectid" TYPE="char" LENGTH="36" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="264" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="description" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="url" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="locked" TYPE="int" LENGTH="1" NOTNULL="false" SEQUENCE="false"/>
Expand All @@ -168,8 +168,8 @@
<TABLE NAME="local_o365_groups_cache" COMMENT="Stores Groups cache">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="objectid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="objectid" TYPE="char" LENGTH="36" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="256" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="description" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
</FIELDS>
<KEYS>
Expand Down
34 changes: 33 additions & 1 deletion local/o365/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,6 @@ function xmldb_local_o365_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2022112831, 'local', 'o365');
}


if ($oldversion < 2022112832) {
// Fix data type issue in calsyncinlastrun config.
$calsyncinlastrun = get_config('local_o365', 'calsyncinlastrun');
Expand Down Expand Up @@ -1291,5 +1290,38 @@ function xmldb_local_o365_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2022112837, 'local', 'o365');
}

if ($oldversion < 2022112838) {
// Changing precision of field objectid on table local_o365_groups_cache to (36).
$table = new xmldb_table('local_o365_groups_cache');
$field = new xmldb_field('objectid', XMLDB_TYPE_CHAR, '36', null, XMLDB_NOTNULL, null, null, 'id');

// Launch change of precision for field objectid.
$dbman->change_field_precision($table, $field);

// Changing precision of field name on table local_o365_groups_cache to (256).
$table = new xmldb_table('local_o365_groups_cache');
$field = new xmldb_field('name', XMLDB_TYPE_CHAR, '256', null, null, null, null, 'objectid');

// Launch change of precision for field name.
$dbman->change_field_precision($table, $field);

// Changing precision of field objectid on table local_o365_teams_cache to (36).
$table = new xmldb_table('local_o365_teams_cache');
$field = new xmldb_field('objectid', XMLDB_TYPE_CHAR, '36', null, XMLDB_NOTNULL, null, null, 'id');

// Launch change of precision for field name.
$dbman->change_field_precision($table, $field);

// Changing precision of field name on table local_o365_teams_cache to (264).
$table = new xmldb_table('local_o365_teams_cache');
$field = new xmldb_field('name', XMLDB_TYPE_CHAR, '264', null, null, null, null, 'objectid');

// Launch change of precision for field objectid.
$dbman->change_field_precision($table, $field);

// O365 savepoint reached.
upgrade_plugin_savepoint(true, 2022112838, 'local', 'o365');
}

return true;
}
2 changes: 1 addition & 1 deletion local/o365/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2022112837;
$plugin->version = 2022112838;
$plugin->requires = 2022112800;
$plugin->release = '4.1.8';
$plugin->component = 'local_o365';
Expand Down

0 comments on commit e459c5e

Please sign in to comment.