Merge branch 'MDL-57432-master' of git://github.com/danpoltawski/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 11 Jul 2017 08:44:06 +0000 (10:44 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 11 Jul 2017 08:44:06 +0000 (10:44 +0200)
1  2 
lib/db/upgrade.php
version.php

@@@ -2887,73 -1914,11 +1914,79 @@@ function xmldb_main_upgrade($oldversion
          upgrade_main_savepoint(true, 2017061301.00);
      }
  
 -    if ($oldversion < 2017071000.00 ) {
 +    if ($oldversion < 2017071000.00) {
 +
 +        // Define field requireconfirmation to be added to oauth2_issuer.
 +        $table = new xmldb_table('oauth2_issuer');
 +        $field = new xmldb_field('requireconfirmation', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '1', 'sortorder');
 +
 +        // Conditionally launch add field requireconfirmation.
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2017071000.00);
 +    }
 +
 +    if ($oldversion < 2017071001.00) {
 +
 +        // Define field timemodified to be added to block_instances.
 +        $table = new xmldb_table('block_instances');
 +        $field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, null,
 +                null, null, 'configdata');
 +
 +        // Conditionally launch add field timemodified.
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +
 +            // Set field to current time.
 +            $DB->set_field('block_instances', 'timemodified', time());
 +
 +            // Changing nullability of field timemodified on table block_instances to not null.
 +            $field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL,
 +                    null, null, 'configdata');
 +
 +            // Launch change of nullability for field timemodified.
 +            $dbman->change_field_notnull($table, $field);
 +
 +            // Define index timemodified (not unique) to be added to block_instances.
 +            $index = new xmldb_index('timemodified', XMLDB_INDEX_NOTUNIQUE, array('timemodified'));
 +
 +            // Conditionally launch add index timemodified.
 +            if (!$dbman->index_exists($table, $index)) {
 +                $dbman->add_index($table, $index);
 +            }
 +        }
 +
 +        // Define field timecreated to be added to block_instances.
 +        $field = new xmldb_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, null,
 +                null, null, 'configdata');
 +
 +        // Conditionally launch add field timecreated.
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +
 +            // Set field to current time.
 +            $DB->set_field('block_instances', 'timecreated', time());
 +
 +            // Changing nullability of field timecreated on table block_instances to not null.
 +            $field = new xmldb_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL,
 +                    null, null, 'configdata');
 +
 +            // Launch change of nullability for field timecreated.
 +            $dbman->change_field_notnull($table, $field);
 +        }
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2017071001.00);
 +    }
 +
++    if ($oldversion < 2017071100.00 ) {
+         // Clean old upgrade setting not used anymore.
+         unset_config('upgrade_minmaxgradestepignored');
 -        upgrade_main_savepoint(true, 2017071000.00);
++        upgrade_main_savepoint(true, 2017071100.00);
+     }
      return true;
  }
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2017071001.01;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2017071000.00;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2017071100.00;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.