MDL-55652 grades: Added timemodified as index grade tables

Added timemodified to grade_categories_history,
grade_items_history, grade_outcomes_history,and scale_history.
This commit is contained in:
Derek Henderson 2017-01-10 15:08:17 -05:00 committed by Marina Glancy
parent cd7cd9d9c1
commit a8fe168e08
3 changed files with 41 additions and 2 deletions

View File

@ -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>
</XMLDB>

View File

@ -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;
}

View File

@ -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.