Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update group and team cache tables name column precision #2644

Open
wants to merge 1 commit into
base: MOODLE_403_STABLE
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1171,7 +1171,6 @@ function xmldb_local_o365_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2023100916, 'local', 'o365');
}


if ($oldversion < 2023100917) {
// Fix data type issue in calsyncinlastrun config.
$calsyncinlastrun = get_config('local_o365', 'calsyncinlastrun');
Expand All @@ -1188,5 +1187,38 @@ function xmldb_local_o365_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2023100917, 'local', 'o365');
}

if ($oldversion < 2023100923) {
// 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, 2023100923, '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 = 2023100921;
$plugin->version = 2023100923;
$plugin->requires = 2023100900;
$plugin->release = '4.3.5';
$plugin->component = 'local_o365';
Expand Down