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