MDL-72377 grade: increase size of category hidden fields.
As well as storing 1/0 to indicate hidden state, they are also used to store a timestamp indicating hidden until date. Increasing field size allows these values to be stored without triggering exceptions.
This commit is contained in:
+2
-2
@@ -1927,7 +1927,7 @@
|
||||
<FIELD NAME="aggregateoutcomes" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Aggregate outcomes"/>
|
||||
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
|
||||
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
|
||||
<FIELD NAME="hidden" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
@@ -2068,7 +2068,7 @@
|
||||
<FIELD NAME="aggregateonlygraded" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="aggregate only graded items"/>
|
||||
<FIELD NAME="aggregateoutcomes" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="Aggregate outcomes"/>
|
||||
<FIELD NAME="aggregatesubcats" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" COMMENT="This setting was removed from grade_categories. It is kept here only to preserve history."/>
|
||||
<FIELD NAME="hidden" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
<FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
|
||||
|
||||
@@ -4494,5 +4494,25 @@ privatefiles,moodle|/user/files.php';
|
||||
upgrade_main_savepoint(true, 2022041900.03);
|
||||
}
|
||||
|
||||
if ($oldversion < 2022041901.05) {
|
||||
|
||||
// Changing precision of field hidden on table grade_categories to (10).
|
||||
$table = new xmldb_table('grade_categories');
|
||||
$field = new xmldb_field('hidden', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'timemodified');
|
||||
|
||||
// Launch change of precision for field hidden.
|
||||
$dbman->change_field_precision($table, $field);
|
||||
|
||||
// Changing precision of field hidden on table grade_categories_history to (10).
|
||||
$table = new xmldb_table('grade_categories_history');
|
||||
$field = new xmldb_field('hidden', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'aggregatesubcats');
|
||||
|
||||
// Launch change of precision for field hidden.
|
||||
$dbman->change_field_precision($table, $field);
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2022041901.05);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2022041901.04; // 20220419 = branching date YYYYMMDD - do not modify!
|
||||
$version = 2022041901.05; // 20220419 = branching date YYYYMMDD - do not modify!
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '4.0.1+ (Build: 20220603)'; // Human-friendly version name
|
||||
|
||||
Reference in New Issue
Block a user