Merge branch 'MDL-59067_master' of git://github.com/dmonllao/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 23 Aug 2017 00:55:20 +0000 (02:55 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 23 Aug 2017 00:55:20 +0000 (02:55 +0200)
1  2 
analytics/classes/local/time_splitting/base.php
lib/db/upgrade.php
version.php

@@@ -2308,19 -2308,36 +2308,50 @@@ function xmldb_main_upgrade($oldversion
          upgrade_main_savepoint(true, 2017080700.01);
      }
  
 -    if ($oldversion < 2017081700.01) {
 +    if ($oldversion < 2017082200.00) {
 +        $plugins = ['radius', 'fc', 'nntp', 'pam', 'pop3', 'imap'];
 +
 +        foreach ($plugins as $plugin) {
 +            // Check to see if the plugin exists on disk.
 +            // If it does not, remove the config for it.
 +            if (!file_exists($CFG->dirroot . "/auth/{$plugin}/auth.php")) {
 +                // Clean config.
 +                unset_all_config_for_plugin("auth_{$plugin}");
 +            }
 +        }
 +        upgrade_main_savepoint(true, 2017082200.00);
 +    }
 +
++    if ($oldversion < 2017082200.01) {
+         // Define table analytics_indicator_calc to be created.
+         $table = new xmldb_table('analytics_indicator_calc');
+         // Adding fields to table analytics_indicator_calc.
+         $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
+         $table->add_field('starttime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('endtime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('sampleorigin', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('sampleid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('indicator', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('value', XMLDB_TYPE_NUMBER, '10, 2', null, null, null, null);
+         $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         // Adding keys to table analytics_indicator_calc.
+         $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
+         // Adding indexes to table analytics_indicator_calc.
+         $table->add_index('starttime-endtime-contextid', XMLDB_INDEX_NOTUNIQUE, array('starttime', 'endtime', 'contextid'));
+         // Conditionally launch create table for analytics_indicator_calc.
+         if (!$dbman->table_exists($table)) {
+             $dbman->create_table($table);
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2017081700.01);
++        upgrade_main_savepoint(true, 2017082200.01);
+     }
      return true;
  }
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2017082200.00;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2017081700.01;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2017082200.01;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.