Merge branch 'wip_MDL-47830_m29_pwrotation' of https://github.com/skodak/moodle
authorSam Hemelryk <sam@moodle.com>
Mon, 1 Dec 2014 20:52:45 +0000 (09:52 +1300)
committerDan Poltawski <dan@moodle.com>
Thu, 4 Dec 2014 12:03:15 +0000 (12:03 +0000)
1  2 
lang/en/admin.php
lang/en/auth.php
lib/db/install.xml
lib/db/upgrade.php

Simple merge
Simple merge
@@@ -1,5 -1,5 +1,5 @@@
  <?xml version="1.0" encoding="UTF-8" ?>
- <XMLDB PATH="lib/db" VERSION="20141201" COMMENT="XMLDB file for core Moodle tables"
 -<XMLDB PATH="lib/db" VERSION="20141121" COMMENT="XMLDB file for core Moodle tables"
++<XMLDB PATH="lib/db" VERSION="20141202" COMMENT="XMLDB file for core Moodle tables"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
  >
@@@ -4058,34 -4058,29 +4058,60 @@@ function xmldb_main_upgrade($oldversion
      // Moodle v2.8.0 release upgrade line.
      // Put any upgrade step following this.
  
 -    if ($oldversion < 2014112800.01) {
++
 +    if ($oldversion < 2014120100.00) {
 +
 +        // Define field sslverification to be added to mnet_host.
 +        $table = new xmldb_table('mnet_host');
 +        $field = new xmldb_field('sslverification', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'applicationid');
 +
 +        // Conditionally launch add field sslverification.
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2014120100.00);
 +    }
 +
 +    if ($oldversion < 2014120101.00) {
 +
 +        // Define field component to be added to comments.
 +        $table = new xmldb_table('comments');
 +        $field = new xmldb_field('component', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'contextid');
 +
 +        // Conditionally launch add field component.
 +        if (!$dbman->field_exists($table, $field)) {
 +            $dbman->add_field($table, $field);
 +        }
 +
 +        // Main savepoint reached.
 +        upgrade_main_savepoint(true, 2014120101.00);
 +    }
++
++    if ($oldversion < 2014120102.00) {
+         // Define table user_password_history to be created.
+         $table = new xmldb_table('user_password_history');
+         // Adding fields to table user_password_history.
+         $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
+         $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('hash', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);
+         $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
+         // Adding keys to table user_password_history.
+         $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
+         $table->add_key('userid', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id'));
+         // Conditionally launch create table for user_password_history.
+         if (!$dbman->table_exists($table)) {
+             $dbman->create_table($table);
+         }
+         // Main savepoint reached.
 -        upgrade_main_savepoint(true, 2014112800.01);
++        upgrade_main_savepoint(true, 2014120102.00);
+     }
      return true;
  }