Commit 52adc5e4 authored by Robert Lyon's avatar Robert Lyon Committed by Cecilia Vela Gurovic

Bug 1812120: Making sites with elasticsearch upgrade faster

As sites with 100,000+ views take forever to upgrade

We don't need to re-index the view row changes when adding the new
columns

behatnotneeded

Change-Id: I90143f592c5203a4dfc2fd20d2d4ef1148cf9e95
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 912be9d2
......@@ -1024,10 +1024,12 @@ function xmldb_core_upgrade($oldversion=0) {
if ($oldversion < 2018080900) {
log_debug('Create a new "lockblock" field in "view" table');
drop_elasticsearch_triggers();
$table = new XMLDBTable('view');
$field = new XMLDBField('lockblocks');
$field->setAttributes(XMLDB_TYPE_INTEGER, 1, null, XMLDB_NOTNULL, null, null, null, 0);
add_field($table, $field);
create_elasticsearch_triggers();
}
if ($oldversion < 2018080901) {
......@@ -1078,6 +1080,7 @@ function xmldb_core_upgrade($oldversion=0) {
if ($oldversion < 2018090400) {
log_debug('Add instuctions column in view table');
drop_elasticsearch_triggers();
$table = new XMLDBTable('view');
$field = new XMLDBField('instructions');
$field->setAttributes(XMLDB_TYPE_TEXT);
......@@ -1086,6 +1089,7 @@ function xmldb_core_upgrade($oldversion=0) {
$field = new XMLDBField('instructionscollapsed');
$field->setAttributes(XMLDB_TYPE_INTEGER, 1, null, XMLDB_NOTNULL, null, null, null, 0);
add_field($table, $field);
create_elasticsearch_triggers();
}
if ($oldversion < 2018091200) {
......
Markdown is supported
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