Commit a8fe168e authored by Derek Henderson's avatar Derek Henderson Committed by Marina Glancy
Browse files

MDL-55652 grades: Added timemodified as index grade tables

Added timemodified to grade_categories_history,
grade_items_history, grade_outcomes_history,and scale_history.
parent cd7cd9d9
......@@ -815,6 +815,7 @@
</KEYS>
<INDEXES>
<INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
<INDEX NAME="timemodified" UNIQUE="false" FIELDS="timemodified"/>
</INDEXES>
</TABLE>
<TABLE NAME="stats_daily" COMMENT="to accumulate daily stats">
......@@ -1816,6 +1817,7 @@
</KEYS>
<INDEXES>
<INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
<INDEX NAME="timemodified" UNIQUE="false" FIELDS="timemodified"/>
</INDEXES>
</TABLE>
<TABLE NAME="grade_categories_history" COMMENT="History of grade_categories">
......@@ -1848,6 +1850,7 @@
</KEYS>
<INDEXES>
<INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
<INDEX NAME="timemodified" UNIQUE="false" FIELDS="timemodified"/>
</INDEXES>
</TABLE>
<TABLE NAME="grade_items_history" COMMENT="History of grade_items">
......@@ -1898,6 +1901,7 @@
</KEYS>
<INDEXES>
<INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
<INDEX NAME="timemodified" UNIQUE="false" FIELDS="timemodified"/>
</INDEXES>
</TABLE>
<TABLE NAME="grade_grades_history" COMMENT="History table">
......@@ -3721,4 +3725,4 @@
</INDEXES>
</TABLE>
</TABLES>
</XMLDB>
\ No newline at end of file
</XMLDB>
......@@ -2601,5 +2601,40 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2017092900.00);
}
if ($oldversion < 2017092901.00) {
// Add index on time modified to grade_outcomes_history, grade_categories_history,
// grade_items_history, and scale_history.
$table = new xmldb_table('grade_outcomes_history');
$index = new xmldb_index('timemodified', XMLDB_INDEX_NOTUNIQUE, array('timemodified'));
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
$table = new xmldb_table('grade_items_history');
$index = new xmldb_index('timemodified', XMLDB_INDEX_NOTUNIQUE, array('timemodified'));
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
$table = new xmldb_table('grade_categories_history');
$index = new xmldb_index('timemodified', XMLDB_INDEX_NOTUNIQUE, array('timemodified'));
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
$table = new xmldb_table('scale_history');
$index = new xmldb_index('timemodified', XMLDB_INDEX_NOTUNIQUE, array('timemodified'));
if (!$dbman->index_exists($table, $index)) {
$dbman->add_index($table, $index);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2017092901.00);
}
return true;
}
......@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2017092900.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2017092901.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment