From 6e6a2c73eefe67e6a39bd460b222f359be47c8d5 Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Mon, 29 Dec 2014 09:51:52 +0100 Subject: [PATCH] MDL-48631 mod_lesson: tables 'grade' item have incorrect precision Conflicts: mod/lesson/db/upgrade.php mod/lesson/version.php --- mod/lesson/db/install.xml | 4 ++-- mod/lesson/db/upgrade.php | 16 ++++++++++++++++ mod/lesson/version.php | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mod/lesson/db/install.xml b/mod/lesson/db/install.xml index 73723db1539..9834d326432 100644 --- a/mod/lesson/db/install.xml +++ b/mod/lesson/db/install.xml @@ -15,7 +15,7 @@ - + @@ -188,4 +188,4 @@ - \ No newline at end of file + diff --git a/mod/lesson/db/upgrade.php b/mod/lesson/db/upgrade.php index a52295d1153..91280c92f37 100644 --- a/mod/lesson/db/upgrade.php +++ b/mod/lesson/db/upgrade.php @@ -78,6 +78,22 @@ function xmldb_lesson_upgrade($oldversion) { // Moodle v2.7.0 release upgrade line. // Put any upgrade step following this. + // Moodle v2.8.0 release upgrade line. + // Put any upgrade step following this. + + if ($oldversion < 2014051201) { + + // Changing precision of field grade on table lesson to (10). + $table = new xmldb_table('lesson'); + $field = new xmldb_field('grade', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'conditions'); + + // Launch change of precision for field grade. + $dbman->change_field_precision($table, $field); + + // Lesson savepoint reached. + upgrade_mod_savepoint(true, 2014051201, 'lesson'); + } + return true; } diff --git a/mod/lesson/version.php b/mod/lesson/version.php index f2ae75b9109..7fcc6aa9e1f 100644 --- a/mod/lesson/version.php +++ b/mod/lesson/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2014051200; // The current module version (Date: YYYYMMDDXX) +$plugin->version = 2014051201; // The current module version (Date: YYYYMMDDXX) $plugin->requires = 2014050800; // Requires this Moodle version $plugin->component = 'mod_lesson'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0;