<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
<INDEXES>
- <INDEX NAME="md5key" UNIQUE="false" FIELDS="md5key"/>
+ <INDEX NAME="md5key" UNIQUE="false" FIELDS="md5key" NEXT="timemodified"/>
+ <INDEX NAME="timemodified" UNIQUE="false" FIELDS="timemodified" COMMENT="Mainly to help deletion of expired records from cron" PREVIOUS="md5key"/>
</INDEXES>
</TABLE>
<TABLE NAME="grade_category" COMMENT="to define categories to group activity grades" PREVIOUS="cache_text" NEXT="grade_exceptions">
$result = $result && drop_table($table);
}
+/// Truncate the text_cahe table and add new index
+ if ($result && $oldversion < 2007100802) {
+
+ /// Truncate the cache_text table
+ execute_sql("TRUNCATE TABLE {$CFG->prefix}cache_text", true);
+
+ /// Define index timemodified (not unique) to be added to cache_text
+ $table = new XMLDBTable('cache_text');
+ $index = new XMLDBIndex('timemodified');
+ $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('timemodified'));
+
+ /// Launch add index timemodified
+ $result = $result && add_index($table, $index);
+ }
+
return $result;
}