Skip to content

Commit

Permalink
MDL-27246 customlang report stores the versions in a char field rathe…
Browse files Browse the repository at this point in the history
…r than integer
  • Loading branch information
mudrd8mz committed Apr 27, 2011
1 parent 7daba27 commit 77e4a16
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 3 additions & 3 deletions admin/report/customlang/db/install.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd" xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd"
> >
Expand Down Expand Up @@ -30,11 +30,11 @@
<FIELDS> <FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/> <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="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> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/> <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS> </KEYS>
</TABLE> </TABLE>
</TABLES> </TABLES>
</XMLDB> </XMLDB>
13 changes: 13 additions & 0 deletions admin/report/customlang/db/upgrade.php
Expand Up @@ -57,5 +57,18 @@ function xmldb_report_customlang_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2010111500, 'report', 'customlang'); 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; return $result;
} }
2 changes: 1 addition & 1 deletion admin/report/customlang/version.php
Expand Up @@ -24,5 +24,5 @@


defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();


$plugin->version = 2010120900; $plugin->version = 2011041900;
$plugin->requires = 2010120700; $plugin->requires = 2010120700;

0 comments on commit 77e4a16

Please sign in to comment.