Merge branch 'MDL-60039_master' of git://github.com/dmonllao/moodle
authorDan Poltawski <dan@moodle.com>
Tue, 12 Sep 2017 10:26:18 +0000 (11:26 +0100)
committerDan Poltawski <dan@moodle.com>
Tue, 12 Sep 2017 10:28:59 +0000 (11:28 +0100)
1  2 
lib/db/upgrade.php
version.php

@@@ -2438,33 -2438,13 +2438,42 @@@ function xmldb_main_upgrade($oldversion
  
      if ($oldversion < 2017090700.01) {
  
 -        upgrade_main_savepoint(true, 2017090700.01);
 +        // Define table analytics_prediction_actions to be created.
 +        $table = new xmldb_table('analytics_prediction_actions');
 +
 +        // Adding fields to table analytics_prediction_actions.
 +        $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
 +        $table->add_field('predictionid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('actionname', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
 +
 +        // Adding keys to table analytics_prediction_actions.
 +        $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
 +        $table->add_key('predictionid', XMLDB_KEY_FOREIGN, array('predictionid'), 'analytics_predictions', array('id'));
 +        $table->add_key('userid', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id'));
 +
 +        // Adding indexes to table analytics_prediction_actions.
 +        $table->add_index('predictionidanduseridandactionname', XMLDB_INDEX_NOTUNIQUE,
 +            array('predictionid', 'userid', 'actionname'));
 +
 +        // Conditionally launch create table for analytics_prediction_actions.
 +        if (!$dbman->table_exists($table)) {
 +            $dbman->create_table($table);
 +        }
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2017090700.01);
 +    }
 +
++    if ($oldversion < 2017091200.00) {
+         // Force all messages to be reindexed.
+         set_config('core_message_message_sent_lastindexrun', '0', 'core_search');
+         set_config('core_message_message_received_lastindexrun', '0', 'core_search');
+         // Main savepoint reached.
++        upgrade_main_savepoint(true, 2017091200.00);
+     }
      return true;
  }
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
--$version  = 2017090700.01;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2017091200.00;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.