From 237f05cfdd7c99192eb87b7d91d79fa05f12eec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Fri, 27 Jul 2012 10:49:16 +0200 Subject: [PATCH] MDL-34600 fix question table to match install.xml The oldquestiontextformat was used during previous upgrade and is not necessary any more. Next time we should add these temporary upgrade columns to install.xml files. --- lib/db/upgrade.php | 14 ++++++++++++++ version.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 726428213b3..41e28f5c3e2 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1081,5 +1081,19 @@ function xmldb_main_upgrade($oldversion) { // Main savepoint reached upgrade_main_savepoint(true, 2012072600.01); } + + if ($oldversion < 2012080200.02) { + // Drop obsolete question upgrade field that should have been added to the install.xml. + $table = new xmldb_table('question'); + $field = new xmldb_field('oldquestiontextformat', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0'); + + if ($dbman->field_exists($table, $field)) { + $dbman->drop_field($table, $field); + } + + upgrade_main_savepoint(true, 2012080200.02); + } + + return true; } diff --git a/version.php b/version.php index 6f790c025fb..f67b2cd8e0e 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2012080200.01; // YYYYMMDD = weekly release date of this DEV branch +$version = 2012080200.02; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes