diff --git a/lib/db/install.xml b/lib/db/install.xml index a26be81259d..b64a07fa29c 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -545,8 +545,9 @@ - + + @@ -573,9 +574,10 @@ - + +
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 20e304f71cc..edd29a24de4 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2465,5 +2465,65 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2016122800.00); } + if ($oldversion < 2017020200.01) { + + // Define index useridfrom_timeuserfromdeleted_notification (not unique) to be added to message. + $table = new xmldb_table('message'); + $index = new xmldb_index('useridfrom_timeuserfromdeleted_notification', XMLDB_INDEX_NOTUNIQUE, array('useridfrom', 'timeuserfromdeleted', 'notification')); + + // Conditionally launch add index useridfrom_timeuserfromdeleted_notification. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Define index useridto_timeusertodeleted_notification (not unique) to be added to message. + $index = new xmldb_index('useridto_timeusertodeleted_notification', XMLDB_INDEX_NOTUNIQUE, array('useridto', 'timeusertodeleted', 'notification')); + + // Conditionally launch add index useridto_timeusertodeleted_notification. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + $index = new xmldb_index('useridto', XMLDB_INDEX_NOTUNIQUE, array('useridto')); + + // Conditionally launch drop index useridto. + if ($dbman->index_exists($table, $index)) { + $dbman->drop_index($table, $index); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2017020200.01); + } + + if ($oldversion < 2017020200.02) { + + // Define index useridfrom_timeuserfromdeleted_notification (not unique) to be added to message_read. + $table = new xmldb_table('message_read'); + $index = new xmldb_index('useridfrom_timeuserfromdeleted_notification', XMLDB_INDEX_NOTUNIQUE, array('useridfrom', 'timeuserfromdeleted', 'notification')); + + // Conditionally launch add index useridfrom_timeuserfromdeleted_notification. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Define index useridto_timeusertodeleted_notification (not unique) to be added to message_read. + $index = new xmldb_index('useridto_timeusertodeleted_notification', XMLDB_INDEX_NOTUNIQUE, array('useridto', 'timeusertodeleted', 'notification')); + + // Conditionally launch add index useridto_timeusertodeleted_notification. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + $index = new xmldb_index('useridto', XMLDB_INDEX_NOTUNIQUE, array('useridto')); + + // Conditionally launch drop index useridto. + if ($dbman->index_exists($table, $index)) { + $dbman->drop_index($table, $index); + } + + // Main savepoint reached. + upgrade_main_savepoint(true, 2017020200.02); + } + return true; } diff --git a/message/output/popup/db/install.xml b/message/output/popup/db/install.xml index e915f8fc3e6..6a92e563b01 100644 --- a/message/output/popup/db/install.xml +++ b/message/output/popup/db/install.xml @@ -1,5 +1,5 @@ - @@ -15,6 +15,7 @@ +
diff --git a/message/output/popup/db/upgrade.php b/message/output/popup/db/upgrade.php index ae50d394ab8..a0b031b85a4 100644 --- a/message/output/popup/db/upgrade.php +++ b/message/output/popup/db/upgrade.php @@ -74,5 +74,20 @@ function xmldb_message_popup_upgrade($oldversion) { // Automatically generated Moodle v3.2.0 release upgrade line. // Put any upgrade step following this. + if ($oldversion < 2016122100) { + + // Define index isread (not unique) to be added to message_popup. + $table = new xmldb_table('message_popup'); + $index = new xmldb_index('isread', XMLDB_INDEX_NOTUNIQUE, array('isread')); + + // Conditionally launch add index isread. + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Popup savepoint reached. + upgrade_plugin_savepoint(true, 2016122100, 'message', 'popup'); + } + return true; } diff --git a/message/output/popup/version.php b/message/output/popup/version.php index 5d39cce018f..3313805cb1c 100644 --- a/message/output/popup/version.php +++ b/message/output/popup/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2016122100; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2016112900; // Requires this Moodle version $plugin->component = 'message_popup'; // Full name of the plugin (used for diagnostics) diff --git a/version.php b/version.php index a7955651778..35b002a4dec 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2017020200.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2017020200.02; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.