Merge branch 'MDL-65015-master' of git://github.com/cescobedo/moodle
authorAdrian Greeve <abgreeve@gmail.com>
Thu, 11 Apr 2019 02:14:23 +0000 (10:14 +0800)
committerAdrian Greeve <abgreeve@gmail.com>
Thu, 11 Apr 2019 02:14:23 +0000 (10:14 +0800)
1  2 
lib/db/install.xml
lib/db/upgrade.php
version.php

index e187dea,7f7f0ec..519bb11
mode 100644,100755..100755
@@@ -2933,45 -2934,20 +2933,60 @@@ function xmldb_main_upgrade($oldversion
          upgrade_main_savepoint(true, 2019040200.01);
      }
  
 -    if ($oldversion < 2019040600.01) {
 +    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, 2019040600.04);
 +    }
 +
++    if ($oldversion < 2019041000.02) {
+         // Define field fullmessagetrust to be added to messages.
+         $table = new xmldb_table('messages');
+         $field = new xmldb_field('fullmessagetrust', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'timecreated');
+         // Conditionally launch add field fullmessagetrust.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2019040600.01);
++        upgrade_main_savepoint(true, 2019041000.02);
+     }
      return true;
  }
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2019041000.01;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2019040600.01;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2019041000.02;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.