Merge branch 'master_MDL-28505_Asynchronous_backup_and_restore' of https://github...
authorAdrian Greeve <abgreeve@gmail.com>
Tue, 9 Apr 2019 02:00:23 +0000 (10:00 +0800)
committerAdrian Greeve <abgreeve@gmail.com>
Tue, 9 Apr 2019 02:00:23 +0000 (10:00 +0800)
1  2 
lang/en/moodle.php
lib/db/install.xml
lib/db/upgrade.php
version.php

Simple merge
Simple merge
@@@ -2934,27 -2933,23 +2933,45 @@@ function xmldb_main_upgrade($oldversion
          upgrade_main_savepoint(true, 2019040200.01);
      }
  
 -    if ($oldversion < 2019040800.00) {
 +    if ($oldversion < 2019040600.02) {
 +
 +        // Define key fileid (foreign) to be dropped form analytics_train_samples.
 +        $table = new xmldb_table('analytics_train_samples');
 +        $key = new xmldb_key('fileid', XMLDB_KEY_FOREIGN, ['fileid'], 'files', ['id']);
 +
 +        // Launch drop key fileid.
 +        $dbman->drop_key($table, $key);
 +
 +        // Define field fileid to be dropped from analytics_train_samples.
 +        $table = new xmldb_table('analytics_train_samples');
 +        $field = new xmldb_field('fileid');
 +
 +        // Conditionally launch drop field fileid.
 +        if ($dbman->field_exists($table, $field)) {
 +            $dbman->drop_field($table, $field);
 +        }
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2019040600.02);
 +    }
 +
++    if ($oldversion < 2019040600.04) {
+         // Define field and index to be added to backup_controllers.
+         $table = new xmldb_table('backup_controllers');
+         $field = new xmldb_field('progress', XMLDB_TYPE_NUMBER, '15, 14', null, XMLDB_NOTNULL, null, '0', 'timemodified');
+         $index = new xmldb_index('useritem_ix', XMLDB_INDEX_NOTUNIQUE, ['userid', 'itemid']);
+         // Conditionally launch add field progress.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         // Conditionally launch add index useritem_ix.
+         if (!$dbman->index_exists($table, $index)) {
+             $dbman->add_index($table, $index);
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2019040800.00);
++        upgrade_main_savepoint(true, 2019040600.04);
+     }
      return true;
  }
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2019040600.03;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2019040800.00;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2019040600.04;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.