Changing resource->alltext to medium. MDL-6872

This commit is contained in:
stronk7
2007-01-20 19:32:02 +00:00
parent 26a1b2f35b
commit 0cfdd50bdc
3 changed files with 16 additions and 2 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
<FIELD NAME="type" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="reference"/>
<FIELD NAME="reference" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="type" NEXT="summary"/>
<FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="reference" NEXT="alltext"/>
<FIELD NAME="alltext" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="popup"/>
<FIELD NAME="alltext" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="popup"/>
<FIELD NAME="popup" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="alltext" NEXT="options"/>
<FIELD NAME="options" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="popup" NEXT="timemodified"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="options"/>
+14
View File
@@ -49,6 +49,20 @@ function xmldb_resource_upgrade($oldversion=0) {
$result = $result && change_field_notnull($table, $field);
}
if ($result && $oldversion < 2007012001) {
if ($CFG->dbfamily == 'mysql') { // Only needed under mysql. The rest are long texts since ages
/// Changing precision of field alltext on table resource to (medium)
$table = new XMLDBTable('resource');
$field = new XMLDBField('alltext');
$field->setAttributes(XMLDB_TYPE_TEXT, 'medium', null, XMLDB_NOTNULL, null, null, null, null, 'summary');
/// Launch change of precision for field alltext
$result = $result && change_field_precision($table, $field);
}
}
return $result;
}
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2007012000;
$module->version = 2007012001;
$module->requires = 2006091700; // Requires this Moodle version
$module->cron = 0;