Permalink
Browse files

MDL-27246 customlang report stores the versions in a char field rathe…

…r than integer
  • Loading branch information...
1 parent 7daba27 commit 77e4a16c4f6d15aa775c393528bc4f919891b048 @mudrd8mz mudrd8mz committed Apr 23, 2011
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="admin/report/customlang/db" VERSION="20101115" COMMENT="XMLDB file for Moodle admin/report/customlang"
+<XMLDB PATH="admin/report/customlang/db" VERSION="20110419" COMMENT="XMLDB file for Moodle admin/report/customlang"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
>
@@ -30,11 +30,11 @@
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The normalized name of the plugin" PREVIOUS="id" NEXT="version"/>
- <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The checked out version of the plugin, null of the version is unknown" PREVIOUS="name"/>
+ <FIELD NAME="version" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="The checked out version of the plugin, null if the version is unknown" PREVIOUS="name"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
</TABLES>
-</XMLDB>
+</XMLDB>
@@ -57,5 +57,18 @@ function xmldb_report_customlang_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2010111500, 'report', 'customlang');
}
+ /**
+ * Change the version field from integer to varchar
+ */
+ if ($oldversion < 2011041900) {
+ $table = new xmldb_table('report_customlang_components');
+ $field = new xmldb_field('version', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'name');
+
+ $dbman->change_field_type($table, $field);
+
+ upgrade_plugin_savepoint(true, 2011041900, 'report', 'customlang');
+ }
+
+
return $result;
}
@@ -24,5 +24,5 @@
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2010120900;
+$plugin->version = 2011041900;
$plugin->requires = 2010120700;

0 comments on commit 77e4a16

Please sign in to comment.