<KEY NAME="outcomeid" TYPE="foreign" FIELDS="outcomeid" REFTABLE="grade_outcomes" REFFIELDS="id" PREVIOUS="scaleid"/>
</KEYS>
<INDEXES>
- <INDEX NAME="locktime" UNIQUE="false" FIELDS="locktime" COMMENT="locktime index" NEXT="locked"/>
- <INDEX NAME="locked" UNIQUE="false" FIELDS="locked" COMMENT="locked index" PREVIOUS="locktime" NEXT="itemtype"/>
- <INDEX NAME="itemtype" UNIQUE="false" FIELDS="itemtype" COMMENT="itemtypeindex" PREVIOUS="locked" NEXT="itemtype-needsupdate"/>
- <INDEX NAME="itemtype-needsupdate" UNIQUE="false" FIELDS="itemtype, needsupdate" COMMENT="used in grading cron" PREVIOUS="itemtype" NEXT="gradetype"/>
+ <INDEX NAME="locked-locktime" UNIQUE="false" FIELDS="locked, locktime" COMMENT="used in grading cron" NEXT="itemtype-needsupdate"/>
+ <INDEX NAME="itemtype-needsupdate" UNIQUE="false" FIELDS="itemtype, needsupdate" COMMENT="used in grading cron" PREVIOUS="locked-locktime" NEXT="gradetype"/>
<INDEX NAME="gradetype" UNIQUE="false" FIELDS="gradetype" COMMENT="index for gradetype" PREVIOUS="itemtype-needsupdate"/>
</INDEXES>
</TABLE>
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" PREVIOUS="rawscaleid"/>
</KEYS>
<INDEXES>
- <INDEX NAME="locktime" UNIQUE="false" FIELDS="locktime" COMMENT="locktiem index" NEXT="locked"/>
- <INDEX NAME="locked" UNIQUE="false" FIELDS="locked" COMMENT="Locked index" PREVIOUS="locktime"/>
+ <INDEX NAME="locked-locktime" UNIQUE="false" FIELDS="locked, locktime" COMMENT="used in grading cron"/>
</INDEXES>
</TABLE>
<TABLE NAME="grade_grades_text" COMMENT="This table keeps additional textual information about each individual grade, whether it be automatically generated from the module or entered manually by the teacher. It's here separate from the all-numeric grade_grades for database efficiency reasons." PREVIOUS="grade_grades" NEXT="grade_outcomes_history">
$table->addKeyInfo('outcomeid', XMLDB_KEY_FOREIGN, array('outcomeid'), 'grade_outcomes', array('id'));
/// Adding indexes to table grade_grades
- $table->addIndexInfo('locktime', XMLDB_INDEX_NOTUNIQUE, array('locktime'));
- $table->addIndexInfo('locked', XMLDB_INDEX_NOTUNIQUE, array('locked'));
- $table->addIndexInfo('itemtype', XMLDB_INDEX_NOTUNIQUE, array('itemtype'));
+ $table->addIndexInfo('locked-locktime', XMLDB_INDEX_NOTUNIQUE, array('locked', 'locktime'));
$table->addIndexInfo('itemtype-needsupdate', XMLDB_INDEX_NOTUNIQUE, array('itemtype', 'needsupdate'));
$table->addIndexInfo('gradetype', XMLDB_INDEX_NOTUNIQUE, array('gradetype'));
$table->addKeyInfo('usermodified', XMLDB_KEY_FOREIGN, array('usermodified'), 'user', array('id'));
/// Adding indexes to table grade_grades
- $table->addIndexInfo('locktime', XMLDB_INDEX_NOTUNIQUE, array('locktime'));
- $table->addIndexInfo('locked', XMLDB_INDEX_NOTUNIQUE, array('locked'));
+ $table->addIndexInfo('locked-locktime', XMLDB_INDEX_NOTUNIQUE, array('locked', 'locktime'));
/// Launch create table for grade_grades
$result = $result && create_table($table);
$result = $result && add_field($table, $field);
}
- if ($result && $oldversion < 2007080902) {
+ if ($result && $oldversion < 2007080903) {
/// Define index
$table = new XMLDBTable('grade_grades');
- $index = new XMLDBIndex('locktime');
- $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('locktime'));
-
- if (!index_exists($table, $index)) {
- /// Launch add index
- $result = $result && add_index($table, $index);
- }
-
- /// Define index
- $table = new XMLDBTable('grade_grades');
- $index = new XMLDBIndex('locked');
- $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('locked'));
-
- if (!index_exists($table, $index)) {
- /// Launch add index
- $result = $result && add_index($table, $index);
- }
-
- /// Define index
- $table = new XMLDBTable('grade_items');
- $index = new XMLDBIndex('locktime');
- $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('locktime'));
-
- if (!index_exists($table, $index)) {
- /// Launch add index
- $result = $result && add_index($table, $index);
- }
-
- /// Define index
- $table = new XMLDBTable('grade_items');
- $index = new XMLDBIndex('locked');
- $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('locked'));
+ $index = new XMLDBIndex('locked-locktime');
+ $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('locked', 'locktime'));
if (!index_exists($table, $index)) {
/// Launch add index
/// Define index
$table = new XMLDBTable('grade_items');
- $index = new XMLDBIndex('itemtype');
- $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('itemtype'));
+ $index = new XMLDBIndex('locked-locktime');
+ $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('locked', 'locktime'));
if (!index_exists($table, $index)) {
/// Launch add index