<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="lib/db" VERSION="20080229" COMMENT="XMLDB file for core Moodle tables"
+<XMLDB PATH="lib/db" VERSION="20080307" COMMENT="XMLDB file for core Moodle tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
<INDEXES>
- <INDEX NAME="contextid-lowerboundary" UNIQUE="false" FIELDS="contextid, lowerboundary" COMMENT="index used when fetching context letters"/>
+ <INDEX NAME="contextid-lowerboundary-letter" UNIQUE="true" FIELDS="contextid, lowerboundary, letter" COMMENT="index used when fetching context letters"/>
</INDEXES>
</TABLE>
<TABLE NAME="cache_flags" COMMENT="Cache of time-sensitive flags" PREVIOUS="grade_letters" NEXT="grade_settings">
set_field('grade_items', 'needsupdate', 1, 'needsupdate', 0);
}
+ if ($result && $oldversion < 2008030700) {
+
+ /// Define index contextid-lowerboundary (not unique) to be dropped form grade_letters
+ $table = new XMLDBTable('grade_letters');
+ $index = new XMLDBIndex('contextid-lowerboundary');
+ $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('contextid', 'lowerboundary'));
+
+ /// Launch drop index contextid-lowerboundary
+ $result = $result && drop_index($table, $index);
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2008030700);
+
+ /// Define index contextid-lowerboundary-letter (unique) to be added to grade_letters
+ $table = new XMLDBTable('grade_letters');
+ $index = new XMLDBIndex('contextid-lowerboundary-letter');
+ $index->setAttributes(XMLDB_INDEX_UNIQUE, array('contextid', 'lowerboundary', 'letter'));
+
+ /// Launch add index contextid-lowerboundary-letter
+ $result = $result && add_index($table, $index);
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2008030700);
+ }
+
return $result;
}
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2008030500; // YYYYMMDD = date of the last version bump
+ $version = 2008030700; // YYYYMMDD = date of the last version bump
// XX = daily increments
- $release = '2.0 dev (Build: 20080305)'; // Human-friendly version name
+ $release = '2.0 dev (Build: 20080307)'; // Human-friendly version name
?>