Merge branch 'MDL-41756-master' of https://github.com/jamiepratt/moodle
authorSam Hemelryk <sam@moodle.com>
Tue, 4 Feb 2014 23:35:11 +0000 (12:35 +1300)
committerSam Hemelryk <sam@moodle.com>
Tue, 4 Feb 2014 23:35:11 +0000 (12:35 +1300)
Conflicts:
lib/db/upgrade.php
version.php

1  2 
lib/db/install.xml
lib/db/upgrade.php
version.php

Simple merge
@@@ -2965,45 -2928,19 +2965,59 @@@ function xmldb_main_upgrade($oldversion
      }
  
      if ($oldversion < 2014012300.01) {
 +        // Remove deleted users home pages.
 +        $sql = "DELETE FROM {my_pages}
 +                WHERE EXISTS (SELECT {user}.id
 +                                  FROM {user}
 +                                  WHERE {user}.id = {my_pages}.userid
 +                                  AND {user}.deleted = 1)
 +                AND {my_pages}.private = 1";
 +        $DB->execute($sql);
 +
 +        // Reached main savepoint.
 +        upgrade_main_savepoint(true, 2014012300.01);
 +    }
 +
 +    if ($oldversion < 2014012400.00) {
 +        // Define table lock_db to be created.
 +        $table = new xmldb_table('lock_db');
  
 -        upgrade_main_savepoint(true, 2014012300.01);
 +        // Adding fields to table lock_db.
 +        $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
 +        $table->add_field('resourcekey', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
 +        $table->add_field('expires', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
 +        $table->add_field('owner', XMLDB_TYPE_CHAR, '36', null, null, null, null);
 +
 +        // Adding keys to table lock_db.
 +        $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
 +
 +        // Adding indexes to table lock_db.
 +        $table->add_index('resourcekey_uniq', XMLDB_INDEX_UNIQUE, array('resourcekey'));
 +        $table->add_index('expires_idx', XMLDB_INDEX_NOTUNIQUE, array('expires'));
 +        $table->add_index('owner_idx', XMLDB_INDEX_NOTUNIQUE, array('owner'));
 +
 +        // Conditionally launch create table for lock_db.
 +        if (!$dbman->table_exists($table)) {
 +            $dbman->create_table($table);
 +        }
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2014012400.00);
 +    }
 +
++    if ($oldversion < 2014020500.00) {
+         // Define field variant to be added to question_statistics.
+         $table = new xmldb_table('question_statistics');
+         $field = new xmldb_field('variant', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'subquestion');
+         // Conditionally launch add field variant.
+         if (!$dbman->field_exists($table, $field)) {
+             $dbman->add_field($table, $field);
+         }
+         // Main savepoint reached.
++        upgrade_main_savepoint(true, 2014020500.00);
+     }
      return true;
  }
diff --cc version.php
@@@ -29,7 -29,7 +29,7 @@@
  
  defined('MOODLE_INTERNAL') || die();
  
- $version  = 2014013100.00;              // YYYYMMDD      = weekly release date of this DEV branch.
 -$version  = 2014012300.01;              // YYYYMMDD      = weekly release date of this DEV branch.
++$version  = 2014020500.00;              // YYYYMMDD      = weekly release date of this DEV branch.
                                          //         RR    = release increments - 00 in DEV branches.
                                          //           .XX = incremental changes.