<TABLE NAME="tags" COMMENT="tags structure for moodle" PREVIOUS="post" NEXT="blog_tag_instance">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="type"/>
- <FIELD NAME="type" TYPE="char" LENGTH="255" NOTNULL="true" DEFAULT="official" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
+ <FIELD NAME="type" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="official" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="type" NEXT="text"/>
- <FIELD NAME="text" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid"/>
+ <FIELD NAME="text" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for tags"/>
$result = $result && create_table($table);
}
+
+ /// code to change lenghen tag field to 255, MDL-9095
+ if ($result && $oldversion < 2007040400) {
+
+ /// Define index text (not unique) to be dropped form tags
+ $table = new XMLDBTable('tags');
+ $index = new XMLDBIndex('text');
+ $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('text'));
+
+ /// Launch drop index text
+ $result = $result && drop_index($table, $index);
+
+ $field = new XMLDBField('text');
+ $field->setAttributes(XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, null, 'userid');
+
+ /// Launch change of type for field text
+ $result = $result && change_field_type($table, $field);
+
+ $index = new XMLDBIndex('text');
+ $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('text'));
+
+ /// Launch add index text
+ $result = $result && add_index($table, $index);
+ }
return $result;
}
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2007040200; // YYYYMMDD = date
+ $version = 2007040400; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.9 dev'; // Human-friendly version name