MDL-32113 qtype_numerical: Fix db upgrade step
authorDamyon Wiese <damyon@moodle.com>
Tue, 19 Dec 2017 08:54:25 +0000 (16:54 +0800)
committerDamyon Wiese <damyon@moodle.com>
Tue, 19 Dec 2017 08:54:25 +0000 (16:54 +0800)
The upgrade step was creating a column with no default, which is different to the structure
for a new install. This was picked up by the magical cibot.

question/type/numerical/db/upgrade.php

index 050ffe3..c4f6323 100644 (file)
@@ -37,7 +37,7 @@ function xmldb_qtype_numerical_upgrade($oldversion) {
 
         // Changing length of field multiplier on table question_numerical_units to 38.
         $table = new xmldb_table('question_numerical_units');
-        $field = new xmldb_field('multiplier', XMLDB_TYPE_NUMBER, '38, 19', null, XMLDB_NOTNULL, null, null, 'question');
+        $field = new xmldb_field('multiplier', XMLDB_TYPE_NUMBER, '38, 19', null, XMLDB_NOTNULL, null, '1.00000000000000000000');
 
         // Launch change of length for field multiplier.
         $dbman->change_field_type($table, $field);