Skip to content

Commit 33135d9

Browse files
committed
MDL-84049 badges: Remove default apiversion value
Remove the default value for the apiversion field in the badge_external_backpack table.
1 parent bcf06a0 commit 33135d9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

lib/db/install.xml

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -3404,7 +3404,7 @@
34043404
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
34053405
<FIELD NAME="backpackapiurl" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
34063406
<FIELD NAME="backpackweburl" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
3407-
<FIELD NAME="apiversion" TYPE="char" LENGTH="12" NOTNULL="true" DEFAULT="1.0" SEQUENCE="false"/>
3407+
<FIELD NAME="apiversion" TYPE="char" LENGTH="12" NOTNULL="true" SEQUENCE="false"/>
34083408
<FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
34093409
<FIELD NAME="oauth2_issuerid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="OAuth 2 Issuer"/>
34103410
</FIELDS>

lib/db/upgrade.php

+10
Original file line numberDiff line numberDiff line change
@@ -1382,5 +1382,15 @@ function xmldb_main_upgrade($oldversion) {
13821382
upgrade_main_savepoint(true, 2025011700.02);
13831383
}
13841384

1385+
if ($oldversion < 2025012400.01) {
1386+
// Remove the default value for the apiversion field.
1387+
$table = new xmldb_table('badge_external_backpack');
1388+
$apiversionfield = new xmldb_field('apiversion', XMLDB_TYPE_CHAR, '12', null, XMLDB_NOTNULL, null, null);
1389+
$dbman->change_field_default($table, $apiversionfield);
1390+
1391+
// Main savepoint reached.
1392+
upgrade_main_savepoint(true, 2025012400.01);
1393+
}
1394+
13851395
return true;
13861396
}

version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

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

32-
$version = 2025012400.00; // YYYYMMDD = weekly release date of this DEV branch.
32+
$version = 2025012400.01; // YYYYMMDD = weekly release date of this DEV branch.
3333
// RR = release increments - 00 in DEV branches.
3434
// .XX = incremental changes.
3535
$release = '5.0dev (Build: 20250124)'; // Human-friendly version name

0 commit comments

Comments
 (0)